Re: MySQL date casting..
| From: | Bastien Koert | Date: | Tue, 17 Jan 2006 18:13:12 +0000 |
| Subject: | Re: MySQL date casting.. | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-41047@lists.php.net to get a copy of this message | ||
Youcould also try CASTing (http://dev.mysql.com/doc/refman/5.0/en/cast-functions.html) the data
Bastien
From: <tg-php@gryffyndevelopment.com> To: <php-db@lists.php.net> CC: <php@philip.pjkh.com> Subject: Re: [PHP-DB] MySQL date casting.. Date: Tue, 17 Jan 2006 12:51:44 -0500 Ahh! Thank you Philip! That's what I was looking for! I see what I did wrong now. I was using the date format strings wrong. I was using it like I'd use it for DATE_FORMAT() instead of as an input filter. This is what I was trying to do: select STR_TO_DATE('2003-11-05 06:00 PM', '%Y-%m-%d %H:%i:%s') duh... hah. Thanks! I knew it was something simple. -TG ------------------ What's wrong with [using] this? mysql> select str_to_date('2005-10-27 07:00 PM', '%Y-%m-%d %l:%i %p'); +---------------------------------------------------------+ | str_to_date('2005-10-27 07:00 PM', '%Y-%m-%d %l:%i %p') | +---------------------------------------------------------+| 2005-10-27 19:00:00 |+---------------------------------------------------------+ 1 row in set (0.04 sec) ___________________________________________________________ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php