Bug #60236 [Asn]: TLA timezone dates are not converted properly from timestamp
| From: | pajoye@php.net | Date: | Tue, 15 Nov 2011 08:42:42 +0000 |
| Subject: | Bug #60236 [Asn]: TLA timezone dates are not converted properly from timestamp | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-165151@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60236&edit=1
ID: 60236
Updated by: pajoye@php.net
Reported by: stas@php.net
Summary: TLA timezone dates are not converted properly from
timestamp
Status: Assigned
Type: Bug
Package: Date/time related
Operating System: *
PHP Version: 5.4.0beta2
Assigned To: derick
Block user comment: N
Private report: N
New Comment:
reported at http://bugs.icu-project.org/trac/ticket/8937
Previous Comments:
------------------------------------------------------------------------
[2011-11-07 18:10:33] stas@php.net
Description:
------------
If you convert a date with TLA timezone (like EDT) to timestamp, and then convert
it back from timestamp, resulting date is off by an hour. See example below.
Test script:
---------------
<?php
$t = new DateTime('2010-07-06 18:38:28 EDT');
$ts = $t->format('U');
var_dump($ts);
$t->setTimestamp($ts);
var_dump($t);
Expected result:
----------------
string(10) "1278455908"
object(DateTime)#1 (3) {
["date"]=>
string(19) "2010-07-06 18:38:28"
["timezone_type"]=>
int(2)
["timezone"]=>
string(3) "EDT"
}
Actual result:
--------------
string(10) "1278455908"
object(DateTime)#1 (3) {
["date"]=>
string(19) "2010-07-06 17:38:28"
["timezone_type"]=>
int(2)
["timezone"]=>
string(3) "EDT"
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60236&edit=1