#35660 [NEW]: AIX TZ variable format not understood, yields UTC timezone
From: Bjorn dot Wiberg at its dot uu dot se
Operating system: AIX 5.2.0.0 ML5
PHP version: 5.1.1
PHP Bug Type: Date/time related
Bug description: AIX TZ variable format not understood, yields UTC timezone
Description:
------------
PHP does not understand the notion of the TZ environment variable that IBM
AIX uses, and defaults to the UTC time zone if an "incorrect" TZ value is
encountered.
The format of the TZ variable, and the allowed values, can be found here:
http://publib.boulder.ibm.com/infocenter/pseries/index.jsp?topic=/com.ibm.aix.doc/files/aixfiles/environment.htm
If this could be considered for future releases, that would be a great
relief. As many (all?) other software on the system seem to use the TZ
correctly.
Otherwise, it would be great if the date.timezone setting would act as a
fallback in case the TZ environment variable is considered invalid by
PHP.
And, perhaps, that this is clarified in the documentation
(http://se.php.net/manual/sv/function.date-default-timezone-get.php);
i.e., that an incorrect TZ value directly yields a "UTC" timezone setting.
Reproduce code:
---------------
System environment configuration file /etc/environment contains:
TZ=NFT-1DFT,M3.5.0/02:00:00,M10.5.0/03:00:00
httpd.conf contains:
php_value date.timezone "Europe/Stockholm"
PHP script that displays the reverting-to-UTC behavior of PHP:
<?php
// putenv('TZ=NFT-1DFT,M3.5.0/02:00:00,M10.5.0/03:00:00');
echo 'TZ is: ' . getenv('TZ') . '<BR>';
echo 'date.timezone is: ' . ini_get('date.timezone') . '<BR>';
echo 'date_default_timezone_get() returns: ' .
date_default_timezone_get() . '<BR>';
echo 'Current time is: ' . strftime('%T') . '<BR>';
echo '<BR>';
echo 'Forcing the correct timezone (' . ini_get('date.timezone') .
')...<BR>';
date_default_timezone_set(ini_get('date.timezone'));
echo 'Correct current time is: ' . strftime('%T') . '<BR>';
?>
Expected result:
----------------
That the timezone is picked up and understood by PHP. This would equal the
"Europe/Stockholm" timezone setting. That is:
TZ is: NFT-1DFT,M3.5.0/02:00:00,M10.5.0/03:00:00
date.timezone is: Europe/Stockholm
date_default_timezone_get() returns: Europe/Stockholm
Current time is: 19:20:10
Forcing the correct timezone (Europe/Stockholm)...
Correct current time is: 19:20:10
Actual result:
--------------
TZ is: NFT-1DFT,M3.5.0/02:00:00,M10.5.0/03:00:00
date.timezone is: Europe/Stockholm
date_default_timezone_get() returns: UTC
Current time is: 18:20:10
Forcing the correct timezone (Europe/Stockholm)...
Correct current time is: 19:20:10
--
Edit bug report at http://bugs.php.net/?id=35660&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=35660&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=35660&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=35660&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=35660&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35660&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35660&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35660&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35660&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35660&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35660&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=35660&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=35660&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35660&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35660&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35660&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35660&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35660&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35660&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35660&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35660&r=mysqlcfg
Thread (10 messages)
- Bjorn dot Wiberg at its dot uu dot se
- Bjorn dot Wiberg at its dot uu dot se#35660 [Opn]: AIX TZ variable format not understood, yields UTC timezone
- Bjorn dot Wiberg at its dot uu dot se#35660 [Opn]: AIX TZ variable format not understood, yields UTC timezone
- sniper@php.net#35660 [Opn->Bgs]: AIX TZ variable format not understood, yields UTC timezone
- Bjorn dot Wiberg at its dot uu dot se#35660 [Bgs->Opn]: AIX TZ variable format not understood, yields UTC timezone
- sniper@php.net#35660 [Opn->Asn]: AIX TZ variable format not understood, yields UTC timezone
- derick@php.net#35660 [Asn]: AIX TZ variable format not understood, yields UTC timezone
- Bjorn dot Wiberg at its dot uu dot se#35660 [Asn]: AIX TZ variable format not understood, yields UTC timezone
- derick@php.net#35660 [Asn->Csd]: AIX TZ variable format not understood, yields UTC timezone
- derick@php.net#35660 [Csd]: AIX TZ variable format not understood, yields UTC timezone