<?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
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.