From: jlamas at gmail dot com Operating system: Linux PHP version: 4.3.8 PHP Bug Type: Date/time related Bug description: Function GetDate interprets 2 different timestamps as same date
Description: ------------ The function GetDate interprets the both timestamps as October 17th, 2004. The timestamps are: 1097895600 and 1097978400 Reproduce code: --------------- $tbDataInicial = '2004-10-01'; $tbDataFinal_temp = '2004-10-31'; while ($sDataLoop != $tbDataFinal_temp) { if ($sDataLoop == "") {$sDataLoop=$tbDataInicial;} //Add one more day $nTimeStamp=strtotime($sDataLoop); $sDataLoop = getdate($nTimeStamp); $sDataLoop=date("Y-m-d",mktime(0,0,0,$sDataLoop['mon'],$sDataLoop['mday']+1,$sDataLoop['year'])); } Expected result: ---------------- The while should go through the parameters $tbDataInicial and $tbDataFinal that represents the begin and end dates respectively. Actual result: -------------- This generates and infinite loop since $sDataLoop get stucked on the day October 17th, 2004. -- Edit bug report at http://bugs.php.net/?id=29734&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29734&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29734&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=29734&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=29734&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=29734&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=29734&r=needscript Try newer version: http://bugs.php.net/fix.php?id=29734&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=29734&r=support Expected behavior: http://bugs.php.net/fix.php?id=29734&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=29734&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=29734&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=29734&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29734&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=29734&r=dst IIS Stability: http://bugs.php.net/fix.php?id=29734&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=29734&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=29734&r=float