php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63257 checkdate(): Wrong if year is two digits and year is 2000
Submitted: 2012-10-10 22:17 UTC Modified: 2013-10-01 15:29 UTC
From: php at skay dot se Assigned:
Status: Not a bug Package: *Calendar problems
PHP Version: 5.3.10 OS: Unix
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: php at skay dot se
New email:
PHP Version: OS:

 

 [2012-10-10 22:17 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-10-10 22:22 UTC] php at skay dot se
-Summary: Wrong if year is two digits and year is 2000 +Summary: checkdate(): Wrong if year is two digits and year is 2000 -PHP Version: Irrelevant +PHP Version: 5.3.10
 [2012-10-10 22:22 UTC] 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-11 11:25 UTC] ewgraf at gmail dot com
Seems not a bug.

From manual:
> 'year' The year is between 1 and 32767 inclusive.

int from "00" will be 0
 [2013-10-01 15:29 UTC] mike@php.net
-Status: Open +Status: Not a bug
 [2013-10-01 15:29 UTC] mike@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC