note 106817 added to class.datetimezone
| From: | AurelienMarchand at osu1 dot php dot net | Date: | Thu, 08 Dec 2011 21:11:45 +0000 |
| Subject: | note 106817 added to class.datetimezone | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184986@lists.php.net to get a copy of this message | ||
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
----
Server IP: 66.207.199.35
Probable Submitter: 209.202.82.139
----
Manual Page -- http://www.php.net/manual/en/class.datetimezone.php
Edit -- https://master.php.net/note/edit/106817
Del: integrated -- https://master.php.net/note/delete/106817/integrated
Del: useless -- https://master.php.net/note/delete/106817/useless
Del: bad code -- https://master.php.net/note/delete/106817/bad+code
Del: spam -- https://master.php.net/note/delete/106817/spam
Del: non-english -- https://master.php.net/note/delete/106817/non-english
Del: in docs -- https://master.php.net/note/delete/106817/in+docs
Del: other reasons-- https://master.php.net/note/delete/106817
Reject -- https://master.php.net/note/reject/106817
Search -- https://master.php.net/manage/user-notes.php