Edit report at https://bugs.php.net/bug.php?id=60236&edit=1

 ID:                 60236
 Comment by:         dani...@php.net
 Reported by:        s...@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:

This is probably related to https://bugs.php.net/bug.php?id=55253


Previous Comments:
------------------------------------------------------------------------
[2011-11-07 18:10:33] s...@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

Reply via email to