Check out strtotime in the PHP manual.  It gives a few examples of how to
use the function that I think will answer your first question.  Next, check
out mktime, time, and date.

> -----Original Message-----
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Michael T. Peterson
> Sent: Tuesday, August 03, 2004 11:05 AM
> To: [EMAIL PROTECTED]
> 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

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

Reply via email to