ID:               33871
 User updated by:  jeremy at techtrav dot com
 Reported By:      jeremy at techtrav dot com
-Status:           Bogus
+Status:           Open
 Bug Type:         Date/time related
 Operating System: Windows XP Apache 2
 PHP Version:      5.1.0b3
 New Comment:

Actually I realize 86400*6 should not be right as my code displays
below. It should give you back one hour short, however when I do add
86400*6 onto the day in PHP 5.1.X I am getting the exact 6 days out. 
That would be a problem.  Again PHP 5.0.4 handles this correctly.


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

[2005-07-26 17:49:24] [EMAIL PROTECTED]

Obviosly "6 days" is not equal to "86400*6", exactly because of
daylight savings.
Change this line:
echo date('m/d/Y H:m:s', $date+(86400*6));
to 
echo date('m/d/Y H:m:s', strtotime("+6 days", $date));

------------------------------------------------------------------------

[2005-07-26 17:45:56] jeremy at techtrav dot com

Description:
------------
the newest 5.1.X version of PHP does not seem to work with day light
savings time. the Expected result was recieved from PHP 5.0.4

I am adding 6 days to Oct 25th to cross over daylight savings time on
Oct 30th.  There should be 25 hours in Oct 30th.

Reproduce code:
---------------
$date = strtotime('25 Oct');
echo date('m/d/Y H:m:s', $date+(86400*6));

Expected result:
----------------
10/30/2005 23:10:00 

Actual result:
--------------
10/31/2005 00:10:00 


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=33871&edit=1

Reply via email to