PHP 4.0 Bug #6688 Updated: strtotime() function causes loop in do...while condition
| From: | Bug Database | Date: | Sun, 17 Sep 2000 21:01:54 +0000 |
| Subject: | PHP 4.0 Bug #6688 Updated: strtotime() function causes loop in do...while condition | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-33438@lists.php.net to get a copy of this message | ||
ID: 6688
Updated by: stas
Reported By: simon.cox@matrixds.co.uk
Status: Closed
Bug Type: Date/time related
Assigned To:
Comments:
This seems to be because of daylight saving settings. It is wrong to suppose that day is always
86400 seconds. With DST in effect, day can be a hour shorter or a hour longer when DST is going on
or off.
Previous Comments:
---------------------------------------------------------------------------
[2000-09-12 17:40:59] simon.cox@matrixds.co.uk
Using the following code with the month of October (any year), generates an endless loop; all other
months are fine.
<?
$dtDate = ("10/01/00");
$nMonth = ("10");
do {
// Build a calendar table
$dtDate = (date("m/d/y", (strtotime($dtDate) + 86400)));
} while (date("m", strtotime($dtDate)) == $nMonth);
?>
I am using PHP 4.0.2 and Apache 1.3.12 under MS Windows 98 SE. I have tested this script using
Linux, Apache and PHP3 and it executes OK for all months.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=6688