PHP 4.0 Bug #8609 Updated: putenv failing with TZ

From: Date: Tue, 09 Jan 2001 09:05:19 +0000
Subject: PHP 4.0 Bug #8609 Updated: putenv failing with TZ
Groups: php.dev 
Request: Send a blank email to php-dev+get-43520@lists.php.net to get a copy of this message
ID: 8609 Updated by: sniper Reported By: seth@northrops.com Old-Status: Open Status: Closed Bug Type: Date/time related Assigned To: Comments: Fixed in CVS. --Jani Previous Comments: --------------------------------------------------------------------------- [2001-01-09 03:29:26] seth@northrops.com I noticed that there are still issues with switching between timezones. For example, given the following: <? # foo.php putenv("TZ=Greenwich"); echo date("H")."n"; putenv("TZ=US/Central"); echo date("H")."n"; putenv("TZ=Greenwich"); echo date("H")."n"; ?> $./php3 foo.php Content-type: text/html 03 21 03 $./php4 foo.php X-Powered-By: PHP/4.0.1pl2 Content-type: text/html 03 03 03 $./php4.4 foo.php X-Powered-By: PHP/4.0.4 Content-type: text/html 03 03 03 Notice it worked in php3, but is failing within PHP 4 (including 4.0.4). Also notice that the first switch usually works; though, I've even noticed where the first putenv fails and the script stays within the local timezone. I also noticed there has been previous discussion (but no response?) on the topic: http://marc.theaimsgroup.com/?l=php-general&m=97666005518422&w=2 http://marc.theaimsgroup.com/?l=php-general&m=97157283226980&w=2 Finally, it APPEARS that calling mktime after the putenv in 4.0.x seems to cause the putenv to work. (ie, it seems to activate the TZ change). Absent a mktime, it stays in the local timezone. --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=8609

« previous php.dev (#43520) next »