Posted by crucialmoment on 02/17/06 14:46
>From the manual...
The DATETIME type is used when you need values that contain both date
and time information. MySQL retrieves and displays DATETIME values in
'YYYY-MM-DD HH:MM:SS' format. The supported range is '1000-01-01
00:00:00' to '9999-12-31 23:59:59'.
>From the result, it appears you are not entering the correct format.
Instead of 9/11/1973 14:33:22
enter '1973-09-11 14:33:22'
You can format your date within your qry like this
SELECT DATE_FORMAT(dateOfThing , '%Y - %m %d ') ...;
-> '2006-01-21'
Or use php to format the result
$formatted_date = date("Y-m-d",strtotime($myarray['dateOfThing']));
-> '2006-01-21'
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
http://us3.php.net/manual/en/function.date.php
Navigation:
[Reply to this message]
|