in reply to Re: Re: Formatting MySQL's TIMESTAMP
in thread Formatting MySQL's TIMESTAMP

Well, apart from the timezone that would in DATE_FORMAT syntax equal:

%W %d %M %Y @ %I:%i%p

If you're willing to be a bit database-specific, use UNIX_TIMESTAMP to get the timestamp in epoch-format and then use POSIX::strftime to format your date.
# epoch-date in $epoch use POSIX; my $formatted_date = POSIX::strftime("%A %d %B %Y @ %I:%M%p %Z",localtime($epoch));
If you want to be as non db-specific as possible, take the advice below and forget UNIX_TIMESTAMP. Just select the timestamp-column and use appropriate date-manipulation module to convert it to epoch-format.

Replies are listed 'Best First'.
Re: Re: Re: Re: Formatting MySQL's TIMESTAMP
by rendler (Pilgrim) on Mar 21, 2002 at 09:52 UTC
    Thanks that first option looks good enough for me. Guess I should have really looked at the manual first (lists all the codes).