ID: 35660
User updated by: Bjorn dot Wiberg at its dot uu dot se
Reported By: Bjorn dot Wiberg at its dot uu dot se
Status: Assigned
Bug Type: Date/time related
Operating System: IBM AIX 5.2.0.0 ML5
PHP Version: 5.1.1
Assigned To: derick
New Comment:
Hello Derick!
Thank you for your reply!
Yes, I know, however, performance is not a big issue for us in this
case.
It would be great if those AIX timezones could be added to the built-in
database of known timezones of PHP, or perhaps even better, if PHP would
default to the date.timezone setting if TZ is considered invalid (the
latter is probably easier to achieve and would cover *all* platforms
with "special" TZ formats).
Please e-mail me if you need us to carry out any AIX tests for you!
Wishing you a Merry Christmas and a Happy New year!
Best regards,
Björn
Previous Comments:
------------------------------------------------------------------------
[2005-12-17 18:41:02] [EMAIL PROTECTED]
Just to let you know, using the date_default_timezone_set() function is
preferred over using the TZ env setting as it's faster.
------------------------------------------------------------------------
[2005-12-13 20:44:51] Bjorn dot Wiberg at its dot uu dot se
Hi again!
Setting date.timezone in php.ini doesn't help -- as PHP still reverts
to UTC when it considers the TZ variable invalid.
Unsetting TZ works for PHP, but breaks things for other software
(notably Apache 2, which then logs using UTC instead of the correct
local time). We're using PHP as an Apache DSO (module), so there seems
to be no possiblity of separating those two in terms of the TZ
variable. Using mod_env's UnsetEnv or SetEnv doesn't work (only for CGI
scripts and SSI pages).
Of course, setting the desired timezone with
date_default_timezone_set() works, as does
putenv('TZ=Europe/Stockholm'), but breaks code which relies on that the
date/time returned by the date functions are using local time.
No chance of getting support for the AIX-style TZ format in a future
version?
No chance of getting a
"revert-to-date.timezone-setting-if-TZ-is-unusable" behavior of the
date functions in a future version?
Best regards,
Björn
------------------------------------------------------------------------
[2005-12-13 20:17:14] [EMAIL PROTECTED]
Of course not. It's not the correct one. Just use the php.ini option.
------------------------------------------------------------------------
[2005-12-13 20:04:09] Bjorn dot Wiberg at its dot uu dot se
Another quick note to clarify that the timestamp measured in UTC of
course is correct -- the wording "correct" in the output of my script
might be a bit misleading; the problem is that PHP doesn't recognize
the AIX timezone contained in the TZ variable, nothing else.
------------------------------------------------------------------------
[2005-12-13 19:37:39] Bjorn dot Wiberg at its dot uu dot se
Just a quick note to tell that PHP does log this fact in the Apache
error log:
PHP Notice: date(): Timezone setting (date.timezone) or TZ environment
variable contains an unknown timezone in /apache/htdocs/...
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/35660
--
Edit this bug report at http://bugs.php.net/?id=35660&edit=1