php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63569 DateTimeZone::listAbbreviations() reports inccorrect offset
Submitted: 2012-11-21 00:31 UTC Modified: 2012-11-21 16:13 UTC
From: zippidyzap at gmail dot com Assigned:
Status: Closed Package: Date/time related
PHP Version: 5.3.18 OS: CentOS 6.3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: zippidyzap at gmail dot com
New email:
PHP Version: OS:

 

 [2012-11-21 00:31 UTC] zippidyzap at gmail dot com
Description:
------------
DateTimeZone::listAbbreviations() reports incorrect. When executed on (server time) 2012-11-20T00:00:00-08:00, reported that offset for America/Los_Angeles as -25200.

DateTimeZone::getTransitionOffsets reports the offset correctly as -28800.

Test script:
---------------
<?php
$var = DateTimeZone::listAbbreviations();
print_r($var['pdt'][0]);
		
$timezone = new DateTimeZone("America/Los_Angeles");
print_r($timezone->getTransitions(time(), time()));
?>

Expected result:
----------------
Array
(
    [dst] => 0
    [offset] => -28800
    [timezone_id] => America/Los_Angeles
)
Array
(
    [0] => Array
        (
            [ts] => 1353457792
            [time] => 2012-11-21T00:29:52+0000
            [offset] => -28800
            [isdst] => 
            [abbr] => PST
        )

)

Actual result:
--------------
Array
(
    [dst] => 1
    [offset] => -25200
    [timezone_id] => America/Los_Angeles
)
Array
(
    [0] => Array
        (
            [ts] => 1353457792
            [time] => 2012-11-21T00:29:52+0000
            [offset] => -28800
            [isdst] => 
            [abbr] => PST
        )

)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-11-21 16:13 UTC] zippidyzap at gmail dot com
-Status: Open +Status: Closed
 [2012-11-21 16:13 UTC] zippidyzap at gmail dot com
DateTimeZone::listAbbreviations() reports *all* timezones available, not all *current* timezones.

Maybe the documentation could use some improvement, but this isn't a bug.
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Wed Dec 12 20:01:26 2018 UTC