From: Ilia Alshanetsky Date: Mon, 28 Jul 2003 04:02:55 +0000 (+0000) Subject: MFH: Fixed bug #13142 (strtotime not handling "M d H:i:s Y" format) X-Git-Tag: php-4.3.3RC2~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fc8b10cf712de512b24438285a856bd51bcf3bef;p=php MFH: Fixed bug #13142 (strtotime not handling "M d H:i:s Y" format) --- diff --git a/NEWS b/NEWS index 044e385392..0d797f9325 100644 --- a/NEWS +++ b/NEWS @@ -61,6 +61,7 @@ PHP 4 NEWS - Fixed bug #21855 (Threading issue on HP-UX). (Roshan Naik, Andi, Moriyoshi) - Fixed bug #21074 (Apache2: "ErrorDocument xxx /error.php" broken). (Jani) - Fixed bug #19613 (putenv("VAR=") does not empty VAR on win32). (Zeev) +- Fixed bug #13142 (strtotime not handling "M d H:i:s Y" format). (Ilia) - Fixed bug #11924 (ibase_query(), ibase_execute() mangled passed parameters). (Jani) diff --git a/ext/standard/parsedate.y b/ext/standard/parsedate.y index 28ba0cd401..6fe1fb1b13 100644 --- a/ext/standard/parsedate.y +++ b/ext/standard/parsedate.y @@ -260,6 +260,17 @@ date : tUNUMBER '/' tUNUMBER { ((struct date_yy *)parm)->yyMonth = $1; ((struct date_yy *)parm)->yyDay = $3; } + | tMONTH tUNUMBER tUNUMBER ':' tUNUMBER ':' tUNUMBER tUNUMBER { + ((struct date_yy *)parm)->yyYear = $8; + ((struct date_yy *)parm)->yyMonth = $1; + ((struct date_yy *)parm)->yyDay = $2; + + ((struct date_yy *)parm)->yyHour = $3; + ((struct date_yy *)parm)->yyMinutes = $5; + ((struct date_yy *)parm)->yySeconds = $7; + + ((struct date_yy *)parm)->yyHaveTime = 1; + } | tUNUMBER '/' tUNUMBER '/' tUNUMBER { /* Interpret as YYYY/MM/DD if $1 >= 1000, otherwise as MM/DD/YY. The goal in recognizing YYYY/MM/DD is solely to support legacy