note 118515 added to timezones

From: Date: Fri, 18 Dec 2015 10:11:05 +0000
Subject: note 118515 added to timezones
Groups: php.notes 
Request: Send a blank email to php-notes+get-204478@lists.php.net to get a copy of this message
to know time zones offset in seconds and hours I used this method. <?php $time_zones = $timezone_identifiers = \DateTimeZone::listIdentifiers(); foreach ($time_zones as $time_zone) { $date = new \DateTime('now', new \DateTimeZone($time_zone)); $offset_in_hours = $date->getOffset() / 60 / 60; if (!is_null($offset) && $offset == $offset_in_hours) { echo "{$time_zone}: {$date->getOffset()} ($offset_in_hours)<br>"; } } ?> ---- Server IP: 72.52.91.14 Probable Submitter: 5.53.118.222 ---- Manual Page -- http://php.net/manual/en/timezones.php Edit -- https://master.php.net/note/edit/118515 Del: integrated -- https://master.php.net/note/delete/118515/integrated Del: useless -- https://master.php.net/note/delete/118515/useless Del: bad code -- https://master.php.net/note/delete/118515/bad+code Del: spam -- https://master.php.net/note/delete/118515/spam Del: non-english -- https://master.php.net/note/delete/118515/non-english Del: in docs -- https://master.php.net/note/delete/118515/in+docs Del: other reasons-- https://master.php.net/note/delete/118515 Reject -- https://master.php.net/note/reject/118515 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#204478) next »