Bug #63257 [Com]: checkdate(): Wrong if year is two digits and year is 2000
| From: | ewgraf at gmail dot com | Date: | Thu, 11 Oct 2012 11:25:58 +0000 |
| Subject: | Bug #63257 [Com]: checkdate(): Wrong if year is two digits and year is 2000 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-174019@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63257&edit=1
ID: 63257
Comment by: ewgraf at gmail dot com
Reported by: php at skay dot se
Summary: checkdate(): Wrong if year is two digits and year is
2000
Status: Open
Type: Bug
Package: *Calendar problems
Operating System: Unix
PHP Version: 5.3.10
Block user comment: N
Private report: N
New Comment:
Seems not a bug.
From manual:
> 'year' The year is between 1 and 32767 inclusive.
int from "00" will be 0
Previous Comments:
------------------------------------------------------------------------
[2012-10-10 22:22:19] php at skay dot se
Description:
------------
---
From manual page: http://www.php.net/function.checkdate
---
If year is 2000 the function will return TRUE (provided the rest is valid) - Thats good!
But if year is 00 the function will always return FALSE
Test script:
---------------
echo checkdate("01", "01", "2000");
echo checkdate("01", "01", "00");
Expected result:
----------------
TRUE
TRUE
Actual result:
--------------
TRUE
FALSE
------------------------------------------------------------------------
[2012-10-10 22:17:13] php at skay dot se
Description:
------------
---
From manual page: http://www.php.net/function.checkdate
---
PHP version 5.3.10
If year is 2000 the function will return TRUE (provided the rest is valid) - Thats good!
But if year is 00 the function will always return FALSE
Test script:
---------------
echo checkdate("01", "01", "2000");
echo checkdate("01", "01", "00");
Expected result:
----------------
TRUE
TRUE
Actual result:
--------------
TRUE
FALSE
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63257&edit=1