PHP 4.0 Bug #10180 Updated: date arithmetic gives wrong result
| From: | hholzgra@php.net | Date: | Thu, 05 Apr 2001 10:27:20 +0000 |
| Subject: | PHP 4.0 Bug #10180 Updated: date arithmetic gives wrong result | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-50926@lists.php.net to get a copy of this message | ||
ID: 10180
Updated by: hholzgra
Reported By: ray@rayho.co.uk
Old-Status: Open
Status: Closed
Bug Type: Date/time related
Assigned To:
Comments:
Previous Comments:
---------------------------------------------------------------------------
[2001-04-05 05:44:20] ray@rayho.co.uk
<?
$birthdate = mktime(0, 0, 0, 1, 1, 2001);
// should give 82 days old - correct
$CurDate = mktime(0,0,0,3,24,2001);
printf("<BR>".date("z", $CurDate - $birthdate ) ." days
old");
// should give 83 days old - correct
$CurDate = mktime(0,0,0,3,25,2001);
printf("<BR>".date("z", $CurDate - $birthdate ) ." days
old");
// should give 84 days old - instead gives 83
$CurDate = mktime(0,0,0,3,26,2001);
printf("<BR>".date("z", $CurDate - $birthdate ) ." days
old");
// should give 85 days old - instead gives 84
$CurDate = mktime(0,0,0,3,27,2001);
printf("<BR>".date("z", $CurDate - $birthdate ) ." days
old");
?>
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10180&edit=2