note 90067 added to datetimezone.listabbreviations
| From: | kingskippus at gmail dot com | Date: | Sat, 04 Apr 2009 16:32:38 +0000 |
| Subject: | note 90067 added to datetimezone.listabbreviations | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-152809@lists.php.net to get a copy of this message | ||
Note that the dst field is of boolean type, so if you are doing an identity comparison, you need to
test for true or false, not 0 or 1. For example:
<?php
$timezone_abbreviations = DateTimeZone::listAbbreviations();
foreach ($timezone_abbreviations["est"] as $tz) {
echo $tz['timezone_id'];
// if ($tz['dst'] === 1) will always evaluate to false
if ($tz['dst'] === true) {
echo " (DST observed)<br />\n";
}
// Could use else here, but for illustration...
if ($tz['dst'] === false) {
echo " (DST not observed)<br />\n";
}
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 74.160.32.242
----
Manual Page -- http://www.php.net/manual/en/datetimezone.listabbreviations.php
Edit -- https://master.php.net/note/edit/90067
Del: integrated -- https://master.php.net/note/delete/90067/integrated
Del: useless -- https://master.php.net/note/delete/90067/useless
Del: bad code -- https://master.php.net/note/delete/90067/bad+code
Del: spam -- https://master.php.net/note/delete/90067/spam
Del: non-english -- https://master.php.net/note/delete/90067/non-english
Del: in docs -- https://master.php.net/note/delete/90067/in+docs
Del: other reasons-- https://master.php.net/note/delete/90067
Reject -- https://master.php.net/note/reject/90067
Search -- https://master.php.net/manage/user-notes.php