From: robm at pmci dot com
Operating system: ubuntu 8.04 lts
PHP version: 5.2.9RC3
PHP Bug Type: Date/time related
Bug description: strtotime converts 02/31/2008 to 02/03/2008
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.
--
Edit bug report at http://bugs.php.net/?id=47457&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=47457&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=47457&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=47457&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=47457&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=47457&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=47457&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=47457&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=47457&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=47457&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=47457&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=47457&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=47457&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=47457&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=47457&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47457&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47457&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=47457&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=47457&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=47457&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=47457&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=47457&r=mysqlcfg