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

From: Date: Mon, 28 Jun 2004 22:16:22 +0000
Subject: #28951 [Com]: strtotime bad dates for "Jan 2002"
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-61455@lists.php.net to get a copy of this message
ID: 28951 Comment by: no dot email at nowhere dot com dot invalid Reported By: foxyshadis1 at dslextreme dot com Status: Open Bug Type: Date/time related Operating System: Win2000 PHP Version: 4.3.7 New Comment: strtotime /is/ parsing correctly, it is treating it as Month Day. 2001st of May 2004 = 22nd October 2009. Pass a day to avoid confusion. Previous Comments: ------------------------------------------------------------------------ [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 (#61455) next »