#28951 [Opn]: strtotime bad dates for "Jan 2002"

From: Date: Tue, 29 Jun 2004 07:02:46 +0000
Subject: #28951 [Opn]: strtotime bad dates for "Jan 2002"
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-61467@lists.php.net to get a copy of this message
ID: 28951 User updated by: foxyshadis1 at dslextreme dot com Reported By: foxyshadis1 at dslextreme dot com Status: Open Bug Type: Date/time related Operating System: Win2000 PHP Version: 4.3.7 New Comment: Is this with the win32 version? There may be a discrepancy. Previous Comments: ------------------------------------------------------------------------ [2004-06-29 08:58:43] derick@php.net 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

« previous php.bugs (#61467) next »