note 119939 added to function.timezone-name-from-abbr
| From: | JonStovell | Date: | Sat, 24 Sep 2016 05:34:45 +0000 |
| Subject: | note 119939 added to function.timezone-name-from-abbr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-206659@lists.php.net to get a copy of this message | ||
In some cases, timezone_name_from_abbr() may return a "historical" (i.e. deprecated)
timezone identifier rather than the current standard one for a given location. For example:
<?php
echo timezone_name_from_abbr('EASST'); // prints "Chile/EasterIsland" instead of
"Pacific/Easter"
?>
This means that the returned timezone identifier is not guaranteed to be in the results of
timezone_identifiers_list() unless you include the "backwards compatible" timezones.
<?php
var_dump(in_array(timezone_name_from_abbr('EASST'), timezone_identifiers_list())); //
(bool)false
var_dump(in_array(timezone_name_from_abbr('EASST'),
timezone_identifiers_list(DateTimeZone::ALL_WITH_BC))); // (bool)true
?>
----
Server IP: 72.52.91.14
Probable Submitter: 198.48.161.227
----
Manual Page -- http://php.net/manual/en/function.timezone-name-from-abbr.php
Edit -- https://master.php.net/note/edit/119939
Del: integrated -- https://master.php.net/note/delete/119939/integrated
Del: useless -- https://master.php.net/note/delete/119939/useless
Del: bad code -- https://master.php.net/note/delete/119939/bad+code
Del: spam -- https://master.php.net/note/delete/119939/spam
Del: non-english -- https://master.php.net/note/delete/119939/non-english
Del: in docs -- https://master.php.net/note/delete/119939/in+docs
Del: other reasons-- https://master.php.net/note/delete/119939
Reject -- https://master.php.net/note/reject/119939
Search -- https://master.php.net/manage/user-notes.php