note 106459 added to function.date-default-timezone-set
| From: | atlantic at taridium dot net | Date: | Thu, 10 Nov 2011 19:49:51 +0000 |
| Subject: | note 106459 added to function.date-default-timezone-set | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184379@lists.php.net to get a copy of this message | ||
An easy way to use the browser offset and set the offset without having to know the actual timezone
name is as follows:
So for example if I have a browser offset in minutes (retrieved via Javascript):
$offset_hours = ($browser_offset / 60) * -1;
date_default_timezone_set('Etc/GMT'.($offset_hours<=0 ? '+' :
'').(-$offset_hours));
----
Server IP: 69.147.83.197
Probable Submitter: 96.56.117.210
----
Manual Page -- http://www.php.net/manual/en/function.date-default-timezone-set.php
Edit -- https://master.php.net/note/edit/106459
Del: integrated -- https://master.php.net/note/delete/106459/integrated
Del: useless -- https://master.php.net/note/delete/106459/useless
Del: bad code -- https://master.php.net/note/delete/106459/bad+code
Del: spam -- https://master.php.net/note/delete/106459/spam
Del: non-english -- https://master.php.net/note/delete/106459/non-english
Del: in docs -- https://master.php.net/note/delete/106459/in+docs
Del: other reasons-- https://master.php.net/note/delete/106459
Reject -- https://master.php.net/note/reject/106459
Search -- https://master.php.net/manage/user-notes.php