PHP 4.0 Bug #7203 Updated: Lack of calling tzset() in some php internal code

From: Date: Tue, 02 Jan 2001 22:58:08 +0000
Subject: PHP 4.0 Bug #7203 Updated: Lack of calling tzset() in some php internal code
Groups: php.dev 
Request: Send a blank email to php-dev+get-42723@lists.php.net to get a copy of this message
ID: 7203 Updated by: derick Reported By: christian.robert@polymtl.ca Old-Status: Open Status: Assigned Bug Type: Date/time related Assigned To: derick Comments: The tzset documentation on Linux says this: The tzset() function initializes the tzname variable from the TZ environment variable. This function is automati­ cally called by the other time conversion functions that depend on the time zone. But strftime is really a libc thingy, and is not emulated in PHP. Please also try php 4.0.4, there where some fixes in it that had to do with date and time stuff. Previous Comments: --------------------------------------------------------------------------- [2000-10-14 04:27:04] christian.robert@polymtl.ca I recently found a problem on a php piece of code who looks like: putenv("TZ=$Some_TZ"); // Like "EST5EDT" $val= strftime("%Z"); echo "Timezone = ".$val; It sometimes get the right value, sometimes some "near" garbage values. Not repeateable (at random under apache). it looks like that under standard linux(glibc2), all "time" related function should call "C" function tzset() before first usage. I see in the source that: _php_mktime() is calling tzset() #if HAVE_TZSET the strftime() function need this too (for linux at least) thanks, Xtian. --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=7203

« previous php.dev (#42723) next »