note 106817 deleted from class.datetimezone by danbrown
| From: | danbrown@php.net | Date: | Mon, 09 Jan 2012 18:03:51 +0000 |
| Subject: | note 106817 deleted from class.datetimezone by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-185474@lists.php.net to get a copy of this message | ||
Note Submitter: Aurelien Marchand
----
Keep in mind that at least with version 5.3.3, ETC/GMT+5 in fact refers to GMT-5 and ETC/GMT-5
refers to GMT+5. I would suppose it's the same for other timezone. This might have been
corrected in newer versions.
Proof:
<?php
$tz = new DateTimeZone("Etc/GMT-5");
$transitions = $tz->getTransitions();
echo $transitions[0]["offset"];
// returns 18000
$tz = new DateTimeZone("Etc/GMT+5");
$transitions = $tz->getTransitions();
echo $transitions[0]["offset"];
// returns -18000
$tz = new DateTimeZone("US/Eastern"); // which is in fact GMT-5 and not GMT+5 during the
winter
$transitions = $tz->getTransitions(1293840000); // that's 2011-01-01 00:00:00 GMT,
guaranteed to be in winter time in US/Eastern
echo $transitions[0]["offset"];
// returns -18000
?>
Like I said, it might be fixed in newer versions