php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69577 PDT timezone is wrong
Submitted: 2015-05-05 21:58 UTC Modified: 2015-05-06 21:11 UTC
From: dbaley at xcastlabs dot com Assigned: cmb (profile)
Status: Not a bug Package: timezonedb (PECL)
PHP Version: 5.6.8 OS: centos 6
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.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dbaley at xcastlabs dot com
New email:
PHP Version: OS:

 

 [2015-05-05 21:58 UTC] dbaley at xcastlabs dot com
Description:
------------
The PDT timezone is returning -0800 when it should be -0700. 

Test script:
---------------
<?php
$d =  new DateTime('NOW', new DateTimeZone('PST'));
echo $d->format('Y-m-d h:m:s e O') . "\n";

$d =  new DateTime('NOW', new DateTimeZone('PDT'));
echo $d->format('Y-m-d h:m:s e O') . "\n";

$d =  new DateTime('NOW', new DateTimeZone('America/Los_Angeles'));
echo $d->format('Y-m-d h:m:s e O') . "\n";
?>

Expected result:
----------------
Expected correct output:
2015-05-05 01:05:08 PST -0800
2015-05-05 01:05:08 PDT -0700
2015-05-05 02:05:08 America/Los_Angeles -0700

Actual result:
--------------
Given incorrect output:
2015-05-05 01:05:08 PST -0800
2015-05-05 01:05:08 PDT -0800
2015-05-05 02:05:08 America/Los_Angeles -0700

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-05-06 20:48 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2015-05-06 20:48 UTC] cmb@php.net
According to the manual[1], PST and PDT are unsupported. See
particularly the list of other timezones[2] and the warnings given
there. 

[1] <http://php.net/manual/en/timezones.php>
[2] <http://php.net/manual/en/timezones.others.php>
 [2015-05-06 21:11 UTC] dbaley at xcastlabs dot com
Ah, my confusion came from upgrading an early php 5.5 to 5.6. Thanks for taking the time to point out the issue.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC