ID:               29734
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jlamas at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Date/time related
 Operating System: Linux
 PHP Version:      4.3.8
 New Comment:

We are happy to tell you that you just discovered Daylight Savings
Time. For more information see:
http://webexhibits.org/daylightsaving/b.html
Instead of using mktime/date consider using gmmktime and gmdate which
do
not suffer from DST.

This has something to do with DST changeover, consult
http://php.net/support.php for more information.


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

[2004-08-18 15:17:59] jlamas at gmail dot com

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 this bug report at http://bugs.php.net/?id=29734&edit=1

Reply via email to