#19838 [Opn]: Oct 27, 2002

From: Date: Wed, 09 Oct 2002 21:16:07 +0000
Subject: #19838 [Opn]: Oct 27, 2002
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-21986@lists.php.net to get a copy of this message
ID: 19838 User updated by: danielkim@rogers.com Reported By: danielkim@rogers.com Status: Open Bug Type: Date/time related Operating System: Windows 2000 PHP Version: 4.2.0 New Comment: <?php // Arbitrary dates to find out a day value in int $dayX = strtotime('Jan 2 2002') - strtotime('Jan 1 2002'); $dayY = strtotime('April 28 1999') - strtotime('April 27 1999'); if ($dayX == $dayY){ $aDay = $dayX; //$aDay = 86400; $date[0] = strtotime('Oct 24 2002'); print date("M j 'y", $date[0]); print '<br>'; for ($i=1; $i<10; $i++){ $date[$i] = $date[$i-1] + $aDay; print date("M j 'y", $date[$i]); print '<br>'; } } ?> The code prints Oct 24 '02 Oct 25 '02 Oct 26 '02 Oct 27 '02 Oct 27 '02 Oct 28 '02 Oct 29 '02 Oct 30 '02 Oct 31 '02 Nov 1 '02 Previous Comments: ------------------------------------------------------------------------ [2002-10-09 16:07:42] danielkim@rogers.com <?php // Arbitrary dates to find out a day value in int $dayX = strtotime('Jan 2 2002') - strtotime('Jan 1 2002'); $dayY = strtotime('April 28 1999') - strtotime('April 27 1999'); if ($dayX == $dayY){ $aDay = $dayX; //$aDay = 86400; $date[0] = strtotime('Oct 20 2002'); print date("M j 'y", $date[0]); print '<br>'; for ($i=1; $i<10; $i++){ $date[$i] = $date[$i-1] + $aDay; print date("M j 'y", $date[$i]); print '<br>'; } } ?> The code prints Oct 20 '02 Oct 21 '02 Oct 22 '02 Oct 23 '02 Oct 24 '02 Oct 25 '02 Oct 26 '02 Oct 27 '02 Oct 27 '02 Oct 28 '02 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19838&edit=1

« previous php.bugs (#21986) next »