strtotime time zone trouble
| From: | Marcus Bointon | Date: | Tue, 18 Jan 2005 10:06:02 +0000 |
| Subject: | strtotime time zone trouble | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-206622@lists.php.net to get a copy of this message | ||
How is this not a bug?
<?php
print date('Y-m-d H:i:s', strtotime('now UTC'))."\n";
print date('Y-m-d H:i:s', strtotime('now PST'))."\n";
?>
outputs:
2005-01-18 09:58:09 (correct)
2005-01-18 17:58:09 (incorrect)
The time zone correction is applied in the wrong direction. Does it in both current PHP 4 and 5.
Named time zones like these are supposedly deprecated, but the suggested alternative in the docs doesn't work at all:
print date('Y-m-d H:i:s', strtotime('now UTC-0800'))."\n";
1970-01-01 00:59:59
using 08:00 doesn't work either
Ideas?
Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
marcus@synchromedia.co.uk | http://www.synchromedia.co.uk