Page 1 of 1

Input format for SQL dates

Posted: Thu Jul 15, 2004 8:52 am
by mjseaden
Dear All,

I have a PHP POST variable containing a date in DD/MM/YYYY format string. How do I record this to a DATE field in a MySQL table? Do I have to break up the string using explode() and somehow write the day month and year numbers separately?

Many thanks

Mark

Posted: Thu Jul 15, 2004 9:08 am
by kettle_drum
http://dev.mysql.com/doc/mysql/en/DATETIME.html

Or you could convert it to the unix epoch time and store it as a int(10) field.

Posted: Thu Jul 15, 2004 5:40 pm
by mjseaden
Thanks kettle.