iliaa Mon Jul 28 00:01:32 2003 EDT
Added files:
/php-src/ext/standard/tests/time bug13142.phpt
Modified files:
/php-src/ext/standard parsedate.y
Log:
Fixed bug #13142 (strtotime not handling "M d H:i:s Y" format)
Index: php-src/ext/standard/parsedate.y
diff -u php-src/ext/standard/parsedate.y:1.35 php-src/ext/standard/parsedate.y:1.36
--- php-src/ext/standard/parsedate.y:1.35 Fri Mar 28 08:10:52 2003
+++ php-src/ext/standard/parsedate.y Mon Jul 28 00:01:32 2003
@@ -8,7 +8,7 @@
** This code is in the public domain and has no copyright.
*/
-/* $Id: parsedate.y,v 1.35 2003/03/28 13:10:52 ddhill Exp $ */
+/* $Id: parsedate.y,v 1.36 2003/07/28 04:01:32 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