From: ebrueggeman at gmail dot com
Operating system: Windows
PHP version: 5.2.4
PHP Bug Type: Date/time related
Bug description: Daylight Savings Time Related Problem with Date()
Description:
------------
The date() function is not accurately displaying output expected of dates
during the 1 week long time before daylight savings time, likely because of
the change in the start of daylight savings time from the year prior.
Reproduce code:
---------------
date_default_timezone_set ("America/New_York");
$receiptStamp=mktime(0, 0, 0, 10, 31, 2007);
$modStamp= $receiptStamp + (5 * 24 * 60 * 60); /* Addition of 5 days of
time */
echo date('m/d/Y', $modStamp) . '<br>';
/*
prints 11/04/2007
*/
$dateObject=new DateTime("10/31/2007");
$dateObject->modify("+5 day");
echo date_format( $dateObject, 'm/d/Y' ). '<br>';
/*
prints 11/05/2007
*/
/*After the old daylight savings crossover week*/
$dateObject=new DateTime("11/7/2007");
$dateObject->modify("+5 day");
echo date_format( $dateObject, 'm/d/Y' ). '<br>';
/*
prints 11/12/2007
*/
$receiptStamp=mktime(0, 0, 0, 11, 7, 2007);
$modStamp= $receiptStamp + (5 * 24 * 60 * 60); /* Addition of 5 days of
time */
echo date('m/d/Y', $modStamp). '<br>';
Expected result:
----------------
11/05/2007
11/05/2007
11/12/2007
11/12/2007
Actual result:
--------------
11/04/2007
11/05/2007
11/12/2007
11/12/2007
--
Edit bug report at http://bugs.php.net/?id=43188&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=43188&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=43188&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=43188&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=43188&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43188&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=43188&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=43188&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=43188&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=43188&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=43188&r=support
Expected behavior: http://bugs.php.net/fix.php?id=43188&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=43188&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=43188&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43188&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43188&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43188&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=43188&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=43188&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=43188&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=43188&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=43188&r=mysqlcfg