php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40932 Timezone ignored
Submitted: 2007-03-27 21:09 UTC Modified: 2007-04-05 01:00 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: chrisw at kc dot net dot nz Assigned:
Status: No Feedback Package: Date/time related
PHP Version: 4.4.6 OS: Windows XP
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-03-27 21:09 UTC] chrisw at kc dot net dot nz
Description:
------------
I get the same date() output regardless of TZ setting on Windows XP. I suspect it must be a configuration error, as I get the same problem with PHP 4.4.2, 4.4.6 and 5.2.1 with date.timezone = Pacific/Auckland
Have also tried on two separate Windows XP machines.
Doing this on Linux works fine and gives expected result.
Web Server is Apache 2.0.55

Reproduce code:
---------------
<?php
putenv("TZ=Pacific/Auckland");
echo "Pacific/Auckland Time: ". date("h:i:s a T")."<br/>";
putenv("TZ=Australia/Sydney");
echo "Australia/Sydney Time: ". date("h:i:s a T")."<br/>";
?>

Expected result:
----------------
I expect to see the timestamp for Pacific/Auckland to be GMT+12
I expect to see the timestamp for Australia/Sydney to be GMT+10




Actual result:
--------------
I get both times output identical as UTC/GMT

e.g.

Pacific/Auckland Time: 09:01:22 pm Pac
Australia/Sydney Time: 09:01:22 pm Aus

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-28 08:50 UTC] derick@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


Works fine for me with PHP 5.2.1 - this is not going to work with PHP 4.x or 5.0.x as Windows uses different zone names. For PHP 5.1.x and higher, use the date_default_timezone_set function instead of using unreliable TZ environment vars.
 [2007-04-05 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jul 31 17:01:26 2021 UTC