#42155 [Opn->Bgs]: checkdate() incorrect behaviour for leap year
| From: | scottmac@php.net | Date: | Tue, 31 Jul 2007 11:01:48 +0000 |
| Subject: | #42155 [Opn->Bgs]: checkdate() incorrect behaviour for leap year | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-115584@lists.php.net to get a copy of this message | ||
ID: 42155
Updated by: scottmac@php.net
Reported By: ahlers_wim at hotmail dot com
-Status: Open
+Status: Bogus
Bug Type: Date/time related
Operating System: All
PHP Version: 5.2.3
New Comment:
Years divisible by 400 *are* leap years,
Years divisible by 100 are not leap years
Years divisible by 4 *are* leap years
php -r "var_dump(checkdate(2, 29, 2000));"
bool(true)
php -r "var_dump(checkdate(2, 29, 2100));"
bool(false)
php -r "var_dump(checkdate(2, 29, 2200));"
bool(false)
php -r "var_dump(checkdate(2, 29, 2300));"
bool(false)
php -r "var_dump(checkdate(2, 29, 2400));"
bool(true)
Previous Comments:
------------------------------------------------------------------------
[2007-07-31 09:40:42] ahlers_wim at hotmail dot com
Description:
------------
Dates divisible by 400 should not be a leap year. (for milleniums to
come.)
checkdate() should be modified to incorporate this date related cycle.
Reproduce code:
---------------
checkdate(2, 29, 2000);
Expected result:
----------------
FALSE
Actual result:
--------------
TRUE
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42155&edit=1