php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55619 checkdate() returns incorrect results
Submitted: 2011-09-06 11:33 UTC Modified: 2011-09-06 12:03 UTC
From: invisiblexman2010 at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.3.2 OS: linux 2.6.32-33-generic on i686
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: invisiblexman2010 at gmail dot com
New email:
PHP Version: OS:

 

 [2011-09-06 11:33 UTC] invisiblexman2010 at gmail dot com
Description:
------------
Function checkdate() returns incorrect results in some cases, when passed February 29 leap year.

Test script:
---------------
var_dump(checkdate('02', '29', '2100'));
var_dump(checkdate('02', '29', '1900'));

Expected result:
----------------
bool(true) bool(true)

Actual result:
--------------
bool(false) bool(false)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-06 11:46 UTC] invisiblexman2010 at gmail dot com
-Summary: incorrect results +Summary: checkdate() returns incorrect results -PHP Version: Irrelevant +PHP Version: 5.3.2
 [2011-09-06 11:46 UTC] invisiblexman2010 at gmail dot com
Update Summary section
 [2011-09-06 12:03 UTC] derick@php.net
-Status: Open +Status: Bogus
 [2011-09-06 12:03 UTC] derick@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

This is correct behaviour: http://en.wikipedia.org/wiki/Leap_year#Algorithm
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Oct 27 16:01:27 2024 UTC