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

From: Date: Tue, 29 Dec 2009 07:57:11 +0000
Subject: note 95361 added to function.date-default-timezone-set
Groups: php.notes 
Request: Send a blank email to php-notes+get-164419@lists.php.net to get a copy of this message
that dude's code above needs to have a $offset = $offset*60*60; in it, like so: <?php function set_tz_by_offset($offset) { $offset = $offset*60*60; $abbrarray = timezone_abbreviations_list(); foreach ($abbrarray as $abbr) { //echo $abbr."<br>"; foreach ($abbr as $city) { //echo $city['offset']." $offset<br>"; if ($city['offset'] == $offset) { // remember to multiply $offset by -1 if you're getting it from js date_default_timezone_set($city['timezone_id']); return true; } } } date_default_timezone_set("ust"); return false; } set_tz_by_offset(-1); ?> ---- Server IP: 69.147.83.197 Probable Submitter: 65.60.56.139 ---- Manual Page -- http://www.php.net/manual/en/function.date-default-timezone-set.php Edit -- https://master.php.net/note/edit/95361 Del: integrated -- https://master.php.net/note/delete/95361/integrated Del: useless -- https://master.php.net/note/delete/95361/useless Del: bad code -- https://master.php.net/note/delete/95361/bad+code Del: spam -- https://master.php.net/note/delete/95361/spam Del: non-english -- https://master.php.net/note/delete/95361/non-english Del: in docs -- https://master.php.net/note/delete/95361/in+docs Del: other reasons-- https://master.php.net/note/delete/95361 Reject -- https://master.php.net/note/reject/95361 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#164419) next »