note 95643 deleted from function.date-default-timezone-set by danbrown
| From: | danbrown@php.net | Date: | Wed, 13 Jan 2010 20:21:47 +0000 |
| Subject: | note 95643 deleted from function.date-default-timezone-set by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-164942@lists.php.net to get a copy of this message | ||
Note Submitter: miraglia dot k at gmail dot com
----
To change the timezone using only the GMT offset, you can do this:
1 <?php
2 echo date_default_timezone_get()."\n";
3
4 $offset = -6;
5
6 $zone = timezone_name_from_abbr("", $offset*3600, 0);
7 date_default_timezone_set($zone);
8
9 echo date_default_timezone_get();
10 ?>