#46641 [Opn->Ver]: Timezone format inconsistencies between date() and DateTime::format()
| From: | jani@php.net | Date: | Fri, 21 Nov 2008 18:03:35 +0000 |
| Subject: | #46641 [Opn->Ver]: Timezone format inconsistencies between date() and DateTime::format() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-131188@lists.php.net to get a copy of this message | ||
ID: 46641
Updated by: jani@php.net
Reported By: cross+php at distal dot com
-Status: Open
+Status: Verified
Bug Type: Date/time related
-Operating System: Linux
+Operating System: *
-PHP Version: 5.2.6
+PHP Version: 5CVS, 6CVS (2008-11-21)
Previous Comments:
------------------------------------------------------------------------
[2008-11-21 17:46:13] cross+php at distal dot com
Description:
------------
When using some of the timezone output format characters, notably "e"
and "T", produce different results on a DateTime built from a string
time and calling date() on the results of strtotime().
Reproduce code:
---------------
<?php
$timestr = "2008-11-19 10:51:35.199665-05";
$outformat = "M j Y H:i:s T (e,I,O,P,T,Z)";
$obj = new DateTime($timestr);
print date($outformat, strtotime($timestr)) . "\n";
print $obj->format($outformat) . "\n";
?>
Expected result:
----------------
Nov 19 2008 10:51:35 EST (America/New_York,0,-0500,-05:00,EST,-18000)
Nov 19 2008 10:51:35 EST (America/New_York,0,-0500,-05:00,EST,-18000)
Actual result:
--------------
Nov 19 2008 10:51:35 EST (America/New_York,0,-0500,-05:00,EST,-18000)
Nov 19 2008 10:51:35 GMT-0500 (-05:00,0,-0500,-05:00,GMT-0500,-18000)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46641&edit=1