ID: 42376
Updated by: [EMAIL PROTECTED]
Reported By: piefra at gmail dot com
-Status: Open
+Status: Assigned
Bug Type: Date/time related
Operating System: bof win(5) & linux(4.1)
PHP Version: 5.2.3
-Assigned To:
+Assigned To: derick
Previous Comments:
------------------------------------------------------------------------
[2007-08-22 10:34:50] piefra at gmail dot com
Description:
------------
(sorry for my english i'm french )
using timestamp incrementation with date(H), i found somme datetime
error :
the error occur on the same hours ( 02:00 )
echo date("Y/m/d H:i",gmmktime(2,0,0,03,25,2007)) -> 2007/03/25 03:00
reproductible on every years same month ( end mars )
2007/03/25 03:00,2008/03/30 03:00,2009/03/29 03:00,2010/03/28 03:00
2011/03/27 03:00,2012/03/25 03:00,2013/03/31 03:00,2014/03/30 03:00
2015/03/29 03:00 ...
to find date errors run the code
found on windows/wamp 1.5.0 (php 5.1)
tested on linux/mandriva/appache with php 4.1
all plateform test is x86
Reproduce code:
---------------
<?php
session_cache_expire (0);
echo '<pre>';
$dt1=mktime(0,0,0,1,1,2007);
echo date("Y/m/d H:i",$dt1)."\n";
for ($i=1;$i<24*365*20;$i++){
set_time_limit(0);
$dt2=mktime(date("H",$dt1)+1,date("i",$dt1),0,date("m",$dt1),date("d",$dt1),date("Y",$dt1));
$d=date("H",$dt2)-date("H",$dt1);
if ($d<>1 and $d <>-23) {
echo date("Y/m/d H:i",$dt1)." ".date("Y/m/d H:i",$dt2)."\n";
flush();
}
$dt1=$dt2;
}
echo date("Y/m/d H:i",$dt2)."\n";
echo '<pre>';
?>
Expected result:
----------------
echo date("Y/m/d H:i",gmmktime(2,0,0,03,25,2007)) -> 2007/03/25 02:00
Actual result:
--------------
echo date("Y/m/d H:i",gmmktime(2,0,0,03,25,2007)) -> 2007/03/25 03:00
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42376&edit=1