RE: [PHP] [Q] Converting SQL Datetimes to timestamps
| From: | Vail, Warren | Date: | Tue, 03 Aug 2004 18:15:38 +0000 |
| Subject: | RE: [PHP] [Q] Converting SQL Datetimes to timestamps | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-192574@lists.php.net to get a copy of this message | ||
Try reversing the order in the date to yyyy-mm-dd and I believe it should
work.
Keep in mind that the time variable $ts is not the same as a Mysql timestamp
for example. It conforms to the unix epoch time variable.
Warren Vail
-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of Michael T. Peterson
Sent: Tuesday, August 03, 2004 11:05 AM
To: php-general@lists.php.net
Subject: [PHP] [Q] Converting SQL Datetimes to timestamps
Evidently the strtotime() function will not convert an SQL datetime to a
timestamp. Am I missing something? Here's an example of what I mean:
$sql_datetime = '1948-30-03 01:30:00';
$ts = strtotime( $sql_datetime );
print( $ts.'<br>');
When this script is executed, strtotime() returns -1.
If true, that strtotime() is unable to convert SQL datetimes into
timestamps, how are others accomplishing this?
Cheers,
Michael
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php