note 10139 deleted from date by ronabop
| From: | ronabop@php.net | Date: | Tue, 19 Dec 2000 05:08:13 +0000 |
| Subject: | note 10139 deleted from date by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-8884@lists.php.net to get a copy of this message | ||
Setting the TZ environment variable does not change the date display in PHP4(tested on 4.03p1)
unless you do a call to time() after the putenv. The only PHP4 datetime function that calls tzset()
to update the timezone from the TZ environment variable seems to be time().
So in PHP4 I do
putenv('TZ=Australia/Adelaide');
time(); // Used for sideeffect - does tzset
print strftime("%Zn");
putenv('TZ=Europe/Riga');
time(); // Used for sideeffect - does tzset
print strftime("%Zn");