|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-08-18 15:47 UTC] derick@php.net
[2004-08-18 16:56 UTC] jlamas at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 22 11:00:01 2025 UTC |
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.