From: Operating system: Redhat PHP version: 5.3.1RC1 Package: Date/time related Bug Type: Bug Bug description:strtotime does not handle MySQL Fuzzy Dates Correctly
Description:
------------
The function strtotime doesn't handle MySQL fuzzy dates correctly, in MySQL
it is possible to store fuzzy dates replacing the unknown date figure with
00, for example.
2010-10-00 00:00:00
which is UK format Y-m-d
If you pass this script to strtotime and wrap the date function around it:
date('M y', (strtotime($monrow['eventdate'])));
PHP will return Oct 10, which is a month out as it should return Nov 10.
Workaround is to use str_replace to change the 00 to 01 when processing.
Test script:
---------------
date('M y', (strtotime("2010-10-00 00:00:00")));
Expected result:
----------------
Nov 10 (Month as specified)
Actual result:
--------------
Oct 10 (Previous Month)
--
Edit bug report at http://bugs.php.net/bug.php?id=53417&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=53417&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=53417&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=53417&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=53417&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=53417&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=53417&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=53417&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=53417&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=53417&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=53417&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=53417&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=53417&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=53417&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=53417&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53417&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53417&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=53417&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=53417&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=53417&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=53417&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=53417&r=mysqlcfg
