note 98100 added to function.date-default-timezone-set

From: Date: Wed, 26 May 2010 03:32:07 +0000
Subject: note 98100 added to function.date-default-timezone-set
Groups: php.notes 
Request: Send a blank email to php-notes+get-169608@lists.php.net to get a copy of this message
<?php function setTimezoneByOffset($required_offset) { $abbreviations_list = timezone_abbreviations_list(); foreach ($abbreviations_list as $abbr) { foreach ($abbr as $city) { try { $date = new DateTime('2010-12-21', new DateTimeZone($city['timezone_id'])); $offset = $date->getOffset() / 3600; if ($offset == $required_offset) { date_default_timezone_set($city['timezone_id']); return; } } catch (Exception $e) { continue; } } } } ?> ---- Server IP: 203.169.204.174 Probable Submitter: 124.244.50.167 ---- Manual Page -- http://www.php.net/manual/en/function.date-default-timezone-set.php Edit -- https://master.php.net/note/edit/98100 Del: integrated -- https://master.php.net/note/delete/98100/integrated Del: useless -- https://master.php.net/note/delete/98100/useless Del: bad code -- https://master.php.net/note/delete/98100/bad+code Del: spam -- https://master.php.net/note/delete/98100/spam Del: non-english -- https://master.php.net/note/delete/98100/non-english Del: in docs -- https://master.php.net/note/delete/98100/in+docs Del: other reasons-- https://master.php.net/note/delete/98100 Reject -- https://master.php.net/note/reject/98100 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#169608) next »