iliaa           Mon Jul 28 00:02:56 2003 EDT

  Added files:                 (Branch: PHP_4_3)
    /php-src/ext/standard/tests/time    bug13142.phpt 

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/standard       parsedate.y 
  Log:
  MFH: Fixed bug #13142 (strtotime not handling "M d H:i:s Y" format)
  
  
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.307 php-src/NEWS:1.1247.2.308
--- php-src/NEWS:1.1247.2.307   Sun Jul 27 14:46:03 2003
+++ php-src/NEWS        Mon Jul 28 00:02:55 2003
@@ -61,6 +61,7 @@
 - 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)
   
Index: php-src/ext/standard/parsedate.y
diff -u php-src/ext/standard/parsedate.y:1.34.2.1 
php-src/ext/standard/parsedate.y:1.34.2.2
--- php-src/ext/standard/parsedate.y:1.34.2.1   Mon Mar 31 09:40:46 2003
+++ php-src/ext/standard/parsedate.y    Mon Jul 28 00:02:55 2003
@@ -8,7 +8,7 @@
 **  This code is in the public domain and has no copyright.
 */
 
-/* $Id: parsedate.y,v 1.34.2.1 2003/03/31 14:40:46 ddhill Exp $ */
+/* $Id: parsedate.y,v 1.34.2.2 2003/07/28 04:02:55 iliaa Exp $ */
 
 #include "php.h"
 
@@ -259,6 +259,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.

Index: php-src/ext/standard/tests/time/bug13142.phpt
+++ php-src/ext/standard/tests/time/bug13142.phpt
--TEST--
Bug #13142 strtotime handling of "M d H:i:s Y" format
--SKIPIF--
<?php
if ([EMAIL PROTECTED]("TZ=US/Eastern") || getenv("TZ") != 'US/Eastern') {
        die("skip unable to change TZ enviroment variable\n");
}
?>
--FILE--
<?php
echo date("r\n", strtotime("Sep 04 16:39:45 2001"));
echo date("r\n", strtotime("Sep 04 2001 16:39:45"));    
?>
--EXPECT--
Tue,  4 Sep 2001 16:39:45 -0400
Tue,  4 Sep 2001 16:39:45 -0400



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to