Edit report at http://bugs.php.net/bug.php?id=52350&edit=1

 ID:               52350
 Updated by:       ahar...@php.net
 Reported by:      ftdysa at gmail dot com
 Summary:          strtotime not handling invalid dates
-Status:           Open
+Status:           Bogus
 Type:             Bug
 Package:          Date/time related
 Operating System: Linux 2.6.21.5
 PHP Version:      5.3.2

 New Comment:

This is intended behaviour: bar checkdate(), which is strict by design,
PHP tries 

to be as liberal as possible about accepting dates and conforming
invalid values 

to valid ones. This particular behaviour also mimics the long standing
way the C 

(and PHP) mktime() works in terms of accepting days outside of the
normal range 

for a month.


Previous Comments:
------------------------------------------------------------------------
[2010-07-15 19:57:43] ftdysa at gmail dot com

Description:
------------
strtotime does not return false for the invalid date of February 30.



Test script:
---------------
echo strtotime('2010-02-30');

echo date('r', strtotime('2010-02-30'));

Expected result:
----------------
FALSE

Wed, 31 Dec 1969 19:00:00 -0500



Actual result:
--------------
1267506000

Tue, 02 Mar 2010 00:00:00 -0500




------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52350&edit=1

Reply via email to