php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34710 Etc/GMT+/- timezones display incorrect time with date_default_timezone_set
Submitted: 2005-10-03 04:35 UTC Modified: 2005-10-03 08:07 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: rcronin at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.1.0RC1 OS: CentOS 4
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: rcronin at gmail dot com
New email:
PHP Version: OS:

 

 [2005-10-03 04:35 UTC] rcronin at gmail dot com
Description:
------------
All the Etc/GMT+/- timezones display incorrect times. Example, when Asia/Tokyo is entered as the time zone the correc time is  displayed, Tokyo is GMT+9. When Etc/GMT+9 is entered for the time zone the time is incorrect. Output example:

GMT: 10/03/05 02:28 AM
GMT+9 (Asia/Tokyo): 10/03/05 11:28 AM (correct)
GMT+9 (Etc/GMT+9): 10/02/05 05:28 PM

The same occures for all the Etc timezone inputs except the GMT+0 zones.

I am running CentOS 4 with PHP5.1.0RC1. date.timezone is set to Etc/UTC, as is the server. Server clock is kept in UTC.

Reproduce code:
---------------
http://www.xotion.com/settings/

Expected result:
----------------
Time output is correct for specified time zone.

Actual result:
--------------
Time output is correct only for non-Etc time zones and GMT+0/GMT-0/UTC/Universal.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-03 07:09 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-10-03 08:07 UTC] derick@php.net
This is not a bug, for some reason the Etc/GMT<x> timezones implement the GMT offset the "wrong way". See here what my OS does by default:

derick@kossu:~$ date
Mon Oct  3 08:05:29 CEST 2005
derick@kossu:~$ export TZ=Etc/GMT+9
derick@kossu:~$ date
Sun Oct  2 21:05:36 GMT+9 2005
derick@kossu:~$ export TZ=Etc/GMT-9
derick@kossu:~$ date
Mon Oct  3 15:06:44 GMT-9 2005

I would really recommend NOT to use those though, but rather use "Asia/Tokyo".

 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Apr 28 07:01:29 2025 UTC