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 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: 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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Mon Oct 14 10:01:28 2024 UTC