php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40960 daylight savings offset is incorrect
Submitted: 2007-03-30 14:58 UTC Modified: 2007-03-30 15:45 UTC
From: dave at dtracorp dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2.1 OS: Fedora Core 5
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dave at dtracorp dot com
New email:
PHP Version: OS:

 

 [2007-03-30 14:58 UTC] dave at dtracorp dot com
Description:
------------
the normal timestamp offset from gmt for melbourne, australia is 36 000 seconds. currently, the offset is 32 400 seconds, as we just clicked off daylight savings time. so at midnight 2007/03/30 gmt, it should be 9am 2007/03/31.
The DateTime object is displaying the correct time, but the getOffset() method is giving the incorrect offset. it should be returning 32 400, it is incorrectly returning 36 000.

Reproduce code:
---------------
$gmtTz = new DateTimeZone("Europe/London");
$localTz = new DateTimeZone('Australia/Melbourne');

$gmtDt = new DateTime("now", $gmtTz);
$localDt = new DateTime("now", $localTz);

echo $localTz->getOffset($gmtDt);

Expected result:
----------------
32400

Actual result:
--------------
36000

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-30 15:45 UTC] derick@php.net
AFAIK Melbourne is either GMT+10 or GMT+11, this is what the TZ database says:
Australia/Melbourne  Sat Oct 28 15:59:59 2006 UTC = Sun Oct 29 01:59:59 2006 EST isdst=0 gmtoff=36000
Australia/Melbourne  Sat Oct 28 16:00:00 2006 UTC = Sun Oct 29 03:00:00 2006 EST isdst=1 gmtoff=39600
Australia/Melbourne  Sat Mar 24 15:59:59 2007 UTC = Sun Mar 25 02:59:59 2007 EST isdst=1 gmtoff=39600
Australia/Melbourne  Sat Mar 24 16:00:00 2007 UTC = Sun Mar 25 02:00:00 2007 EST isdst=0 gmtoff=36000
Australia/Melbourne  Sat Oct 27 15:59:59 2007 UTC = Sun Oct 28 01:59:59 2007 EST isdst=0 gmtoff=36000
Australia/Melbourne  Sat Oct 27 16:00:00 2007 UTC = Sun Oct 28 03:00:00 2007 EST isdst=1 gmtoff=39600
Australia/Melbourne  Sat Mar 29 15:59:59 2008 UTC = Sun Mar 30 02:59:59 2008 EST isdst=1 gmtoff=39600
Australia/Melbourne  Sat Mar 29 16:00:00 2008 UTC = Sun Mar 30 02:00:00 2008 EST isdst=0 gmtoff=36000

and also:
http://www.worldtimezone.com/time/wtzresult.php?CiID=1225&forma=24h

Please be aware that London is currently NOT on GMT/UTC, but on BST/UTC+1.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 19 12:00:03 2025 UTC