php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48977 US/Central != Etc/GMT-6
Submitted: 2009-07-19 19:40 UTC Modified: 2009-07-19 21:35 UTC
From: cpriest at warpmail dot net Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.3.0 OS: Vista 64-Bit
Private report: No CVE-ID: None
 [2009-07-19 19:40 UTC] cpriest at warpmail dot net
Description:
------------
When initializing two new DateTime objects using equivalent DateTimeZone()'s of US/Central and Etc/GMT-6, the result is incorrect

Reproduce code:
---------------
$objTime = new DateTime('now', new DateTimeZone('US/Central'));
echo $objTime->format('m/d/Y H:i:s T')."\r\n";
$objTime = new DateTime('now', new DateTimeZone('Etc/GMT-6'));
echo $objTime->format('m/d/Y H:i:s T')."\r\n";


Expected result:
----------------
The same timestamp on two lines (with different TimeZone specifiers)

Actual result:
--------------
Different timestamps.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-19 21:35 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This is not a bug. First of all, *both* of those timezones are only there for backwards compatibility (see the big warning at http://uk.php.net/manual/en/timezones.others.php). Secondly, the timezone database\'s version of Etc/GMT[+-][0-9]+ work the other way around where + means - and thirdly US/Central is currently on GMT-5 hence the 11 hour difference between the output:

07/19/2009 16:32:58 CDT
07/20/2009 03:32:58 GMT-6

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 12:01:33 2024 UTC