PHP 4.0 Bug #7203 Updated: Lack of calling tzset() in some php internal code
| From: | sniper@php.net | Date: | Tue, 09 Jan 2001 09:08:02 +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-43527@lists.php.net to get a copy of this message | ||
ID: 7203
Updated by: sniper
Reported By: christian.robert@polymtl.ca
Old-Status: Assigned
Status: Closed
Bug Type: Date/time related
Assigned To:
Comments:
Fixed in CVS. Thank you for pointing this out.
--Jani
Previous Comments:
---------------------------------------------------------------------------
[2001-01-02 17:58:08] derick@php.net
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.
---------------------------------------------------------------------------
[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