note 114161 added to datetimezone.listabbreviations
| From: | jonathan at hogervorst dot info | Date: | Fri, 17 Jan 2014 23:32:17 +0000 |
| Subject: | note 114161 added to datetimezone.listabbreviations | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-198272@lists.php.net to get a copy of this message | ||
This method returns an associative array containing some 'major' timezones (like CEST),
which on their own contain more specific 'geographic' timezones (like Europe/Amsterdam).
If you're using these timezones and their offset/DST information, it's extremely important
to realize the following:
*It seems like ALL DIFFERENT OFFSET/DST CONFIGURATIONS (including historical configurations) of each
timezone are included!*
For example, Europe/Amsterdam can be found six times in the output of this function. Two occurrences
(offset 1172/4772) are for the Amsterdam time used until 1937; two (1200/4800) are for the time that
was used between 1937 and 1940; and two (3600/4800) are for the time used since 1940.
*Therefore, YOU CANNOT RELY ON THE OFFSET/DST INFORMATION RETURNED BY THIS FUNCTION as being
currently correct/in use!*
If you want to know the current offset/DST of a certain timezone, you'll have to do something
like this:
<?php
$now = new DateTime(null, new DateTimeZone('Europe/Amsterdam'));
echo $now->getOffset();
?>
P.S. I'm sorry for my use of caps lock in this post, but as this behavior is not described in
the documentation, I considered it to be important enough to shout. Normally I don't do such
things :)
----
Server IP: 72.52.91.14
Probable Submitter: 72.52.91.14
----
Manual Page -- http://php.net/manual/en/datetimezone.listabbreviations.php
Edit -- https://master.php.net/note/edit/114161
Del: integrated -- https://master.php.net/note/delete/114161/integrated
Del: useless -- https://master.php.net/note/delete/114161/useless
Del: bad code -- https://master.php.net/note/delete/114161/bad+code
Del: spam -- https://master.php.net/note/delete/114161/spam
Del: non-english -- https://master.php.net/note/delete/114161/non-english
Del: in docs -- https://master.php.net/note/delete/114161/in+docs
Del: other reasons-- https://master.php.net/note/delete/114161
Reject -- https://master.php.net/note/reject/114161
Search -- https://master.php.net/manage/user-notes.php