Re: MySQL date casting..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Youcould also try CASTing (http://dev.mysql.com/doc/refman/5.0/en/cast-functions.html) the data

Bastien

From: <tg-php@xxxxxxxxxxxxxxxxxxxxxx>
To: <php-db@xxxxxxxxxxxxx>
CC: <php@xxxxxxxxxxxxxxx>
Subject: Re:  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


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux