Jeremy wrote:
I've been looking though "MySQL" by Paul DuBois (second edition) and the MySQL docs at http://www.mysql.com/doc/en/Date_and_time_functions.html (and others).

I'm looking for a MySQL function that returns the unix time (second since epoch), and there doesn't seem to be one.

UNIX_TIMESTAMP()



Using a PHP script, what's the best way to store the current time (for example, when a message board post is made) so it can be easily read back and formatted later? I need to be able to use either MySQL's fucntions or the PHP date functions to format the date like "Tuesday, Feb 17, 2004 9:18:30pm".

Store as datetime, use current_datetime() to get the current time to store, date_add() and date_sub() for arithmetic, and date_format() to retrieve.



-- Sasha Pachev Create online surveys at http://www.surveyz.com/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to