ID:               27780
 Updated by:       [EMAIL PROTECTED]
 Reported By:      Hua dot Qu at volvo dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Date/time related
 Operating System: Windows 2000
 PHP Version:      4.3.4
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

You need to add timezone information to the original date. 

For example change your text time to "2004-06-01 00:00:00 

EST". 

 

The end result will be that strtotime($to) will be 1 

smaller then  strtotime("$to +1 seconds "), which is the 

correct output. 


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

[2004-03-30 10:52:02] Hua dot Qu at volvo dot com

Description:
------------
strtotime($tm + 1 xxx) always adds one more hour to the result, if the
result-time is in the summertime, no matter $tm is in the summertime or
not.



It is the same in PHP CVS (5.0.x-dev) Built On: Mar 30, 2004 14:30 GMT



I think it is the daylight-savings-time problem. Perhaps, $tm is not
checked if it is already in the daylight-savings-time. 



There are already some similar reports, but they did not get the point,
and the bug has not been corrected untill  Mar 30, 2004 14:30 GMT.



Reproduce code:
---------------
echo "I have get one hour too much!<br><br>";



$to = "2004-06-01 00:00:00";

echo strtotime($to)."<br>\n";

echo strtotime("$to +1 seconds ")."<br><br>\n";

                

$newtime1 = strftime("%Y-%m-%d %H:%M:%S", strtotime("$to +1 seconds
"));

$newtime2   = strftime("%Y-%m-%d %H:%M:%S", strtotime("$to +1 day "));



echo "$to <br>\n";

echo "+1 s= $newtime1<br>\n";

echo "+1day=$newtime2<br><br>\n";

                

$correct = strftime("%Y-%m-%d %H:%M:%S", strtotime("$to +1 second -1
hour"));

echo "correct: +1 s=$correct<br>";



Expected result:
----------------
If $tm is the summertime, strtotime($tm +1 day) should return 24 hours
more, not 25 hours more.



If $tm is the wintertime and result is in the summertime, it should
return one extra hour. 



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


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

Reply via email to