Re: converting seconds since unix epoc to date array
| From: | Wouter van Vliet | Date: | Tue, 07 Sep 2004 11:17:12 +0000 |
| Subject: | Re: converting seconds since unix epoc to date array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-196027@lists.php.net to get a copy of this message | ||
> beware of dates before 1969.
That problem mostly occurs on windows systems, and in fact it's dates
before 1 jan 1970 0:00 - php on windows will issue a warning if you
try to use dates like that
> > > Can anyone tell me how to convert a date stored in the format
> > > "YYYY-MM-DD" to an integer of seconds since unix epoc,
As for converting a YYYY-MM-DD date to epoch seconds, if it comes for
mysql (as suggested) you should use
select UNIX_TIMESTAMP(date_column), * FROM tablename;
From another source, strtotime should work on this format. Consider
the 1 jan 1970 problem, check your error logs, call
error_reporting(E_ALL); to see for any additional problems... the
problem might as well be a typo in your varname.