Bug #66118 [NEW]: date_format prints incorrect GMT offset during time change hour

From: Date: Tue, 19 Nov 2013 15:38:45 +0000
Subject: Bug #66118 [NEW]: date_format prints incorrect GMT offset during time change hour
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-182831@lists.php.net to get a copy of this message
From: david dot sheldon at carrierweb dot com Operating system: Linux, windows7 PHP version: 5.5.6 Package: Date/time related Bug Type: Bug Bug description:date_format prints incorrect GMT offset during time change hour Description: ------------ For the hour where the clock changes, date() reports the correct offset/timezone abbreviation, and date_format() reports the incorrect offset, appearing to use the offset for an hour later. Test script: --------------- // http://3v4l.org/GVjMn date_default_timezone_set("America/New_York"); $timeStamp = 1352008800; $date= date(DateTime::ISO8601, $timeStamp); $dateTime = new DateTime(); $dateTime->setTimestamp($timeStamp); $dateFormat = date_format($dateTime, DateTime::ISO8601); echo "Date: $date\nDateFormat: $dateFormat\n"; Expected result: ---------------- Both lines the same: Date: 2012-11-04T01:00:00-0500 DateFormat: 2012-11-04T01:00:00-0500 Actual result: -------------- Date: 2012-11-04T01:00:00-0500 DateFormat: 2012-11-04T01:00:00-0400 -- Edit bug report at https://bugs.php.net/bug.php?id=66118&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66118&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66118&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66118&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=66118&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=66118&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=66118&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=66118&r=needscript Try newer version: https://bugs.php.net/fix.php?id=66118&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=66118&r=support Expected behavior: https://bugs.php.net/fix.php?id=66118&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=66118&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=66118&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=66118&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66118&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=66118&r=dst IIS Stability: https://bugs.php.net/fix.php?id=66118&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=66118&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=66118&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=66118&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=66118&r=mysqlcfg

« previous php.bugs (#182831) next »