ID:               43188
 Updated by:       [EMAIL PROTECTED]
 Reported By:      ebrueggeman at gmail dot com
-Status:           Open
+Status:           Assigned
 Bug Type:         Date/time related
 Operating System: Windows
 PHP Version:      5.2.4
-Assigned To:      
+Assigned To:      derick


Previous Comments:
------------------------------------------------------------------------

[2007-11-04 21:51:47] ebrueggeman at gmail dot com

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 this bug report at http://bugs.php.net/?id=43188&edit=1

Reply via email to