Re: [Q] Converting SQL Datetimes to timestamps
| From: | Jason Wong | Date: | Tue, 03 Aug 2004 18:18:33 +0000 |
| Subject: | Re: [Q] Converting SQL Datetimes to timestamps | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-192577@lists.php.net to get a copy of this message | ||
On Wednesday 04 August 2004 02:05, Michael T. Peterson wrote:
> 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,
No it's not true, RTFM.
> how are others accomplishing this?
If you're need to process a wider range of dates use the Julian day functions
manual > Calendar Functions
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
It takes two to tell the truth: one to speak and one to hear.
*/