PHP 4.0 Bug #7518: Rounding problems with mktime() or date()

From: Date: Sun, 29 Oct 2000 10:56:30 +0000
Subject: PHP 4.0 Bug #7518: Rounding problems with mktime() or date()
Groups: php.dev 
Request: Send a blank email to php-dev+get-36337@lists.php.net to get a copy of this message
From: sascha@mantscheff.net Operating system: SuSE Linux 6.4 PHP version: 4.0.1pl2 PHP Bug Type: Date/time related Bug description: Rounding problems with mktime() or date() <?php $DAYS = 3600 * 24; $fdom = mktime( 0, 0, 0, 10, 8, 2000 ); for ($i = 1; $i < 30; $i++) echo date( "d.m.Y", $fdom + ($i - 1) * $DAYS ) . " "; ?> This script should list the day number from October, 08th, through the next 30 days. It repeats the 29th day of October. I don't know why. If the 3rd line is changed to $fdom = mktime( 0, 0, 0, 10, 08, 2000 ); date counting starts on September 30th, so the leading 0 of "08" is misinterpreted as a standalone zero. -- Edit Bug report at: http://bugs.php.net/?id=7518&edit=1

« previous php.dev (#36337) next »