You are here: Re: Weird dates from mssql (4.2.3 / 4.4.0-3) « PHP Programming Language « IT news, forums, messages
Re: Weird dates from mssql (4.2.3 / 4.4.0-3)

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация