php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47457 strtotime converts 02/31/2008 to 02/03/2008
Submitted: 2009-02-20 04:14 UTC Modified: 2009-02-20 10:04 UTC
From: robm at pmci dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2.9RC3 OS: ubuntu 8.04 lts
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: robm at pmci dot com
New email:
PHP Version: OS:

 

 [2009-02-20 04:14 UTC] robm at pmci dot com
Description:
------------
strtotime issue

Reproduce code:
---------------
$datestring = '02/31/2008';
if(strtotime($datestring)) {echo date('d/m/Y',strtotime($datestring));} else  {echo 'not valid date'; exit;}

Expected result:
----------------
expect FALSE on 02/30/2008 and 02/31/2008

addl comment: Have not tested for leap yrs, but hope they will work as well.

Actual result:
--------------
function accepts 02/30/2008 and 02/31/2008 as valid dates, and when I return either timestamp back as a date it returns 02/03/2008.

I AM ACTUALLY USING 5.2.6.  I submitted bug because I imagine it would have to have been fixed by this version if fixed.  If this is already fixed, thanks.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-02-20 10:04 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

.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC