ID: 28951 Updated by: [EMAIL PROTECTED] Reported By: foxyshadis1 at dslextreme dot com -Status: Open +Status: Bogus Bug Type: Date/time related Operating System: Win2000 PHP Version: 4.3.7 New Comment:
strtotime is sort of 'fuzzy' function. Do not pass just anything to it..as you'll get out just about anything then. Previous Comments: ------------------------------------------------------------------------ [2004-06-29 09:02:45] foxyshadis1 at dslextreme dot com Is this with the win32 version? There may be a discrepancy. ------------------------------------------------------------------------ [2004-06-29 08:58:43] [EMAIL PROTECTED] It returns the expected result "29 May 2004" to me. ------------------------------------------------------------------------ [2004-06-29 00:16:21] no dot email at nowhere dot com dot invalid strtotime /is/ parsing correctly, it is treating it as Month Day. 2001st of May 2004 = 22nd October 2009. Pass a day to avoid confusion. ------------------------------------------------------------------------ [2004-06-28 19:50:02] foxyshadis1 at dslextreme dot com Description: ------------ strtotime is attempting and failing to read dates in a "month year" format. Both long and short months are affected. It is then returning wildly wrong timestamps. Since the date cannot be correctly parsed, it should return -1, or be modified to correctly parse it. Reproduce code: --------------- echo date("j M Y",strtotime("May 2001")); Expected result: ---------------- 1 May 2001 or 1 January 1969 Actual result: -------------- 22 Oct 2009 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28951&edit=1