php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51012 February 30th is a valid date for strtotime
Submitted: 2010-02-11 11:21 UTC Modified: 2010-02-11 12:13 UTC
From: stlwrt at gmail dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.3.1 OS: Fedora 12, OSX 10.6.2
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: stlwrt at gmail dot com
New email:
PHP Version: OS:

 

 [2010-02-11 11:21 UTC] stlwrt at gmail dot com
Description:
------------
strtotime accepts "2010-02-30" as a valid date and converts it to 
timestamp

Reproduce code:
---------------
<?php var_dump(strtotime('2010-02-30')); ?>


Expected result:
----------------
bool(false)


Actual result:
--------------
int(1267480800)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-02-11 12:13 UTC] johannes@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

use check_date() for validating dates.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 19 14:00:02 2025 UTC