Bug #60236 [Asn->Csd]: TLA timezone dates are not converted properly from timestamp
| From: | derick@php.net | Date: | Thu, 24 Nov 2011 17:14:00 +0000 |
| Subject: | Bug #60236 [Asn->Csd]: TLA timezone dates are not converted properly from timestamp | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-165477@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: derick@php.net
Reported by: stas@php.net
Summary: TLA timezone dates are not converted properly from
timestamp
-Status: Assigned
+Status: Closed
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:
This bug has been fixed in SVN.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2011-11-24 17:13:34] derick@php.net
Automatic comment from SVN on behalf of derick
Revision: http://svn.php.net/viewvc/?view=revision&revision=319767
Log: - Fixed bug #60236 (TLA timezone dates are not converted properly from
timestamp).
- Fixed bug #55253 (DateTime::add() and sub() result -1 hour on objects with
time zone type 2).
And fixed some test cases.
------------------------------------------------------------------------
[2011-11-21 02:18:55] danielc@php.net
This is probably related to https://bugs.php.net/bug.php?id=55253
------------------------------------------------------------------------
[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