]> granicus.if.org Git - php/commitdiff
- Partial fix for bug #9050, support for "Jan 19 2000" date format
authorDerick Rethans <derick@php.net>
Sun, 6 May 2001 18:33:49 +0000 (18:33 +0000)
committerDerick Rethans <derick@php.net>
Sun, 6 May 2001 18:33:49 +0000 (18:33 +0000)
ext/standard/parsedate.y
ext/standard/tests/time/002.phpt [new file with mode: 0644]

index a0bb517b88c16a730f187d211ef13520fe8bbe44..64e899d98d0b6bd90135f3c635ce5d88c0489ddd 100644 (file)
@@ -320,6 +320,11 @@ date       : tUNUMBER '/' tUNUMBER {
            yyMonth = $2;
            yyYear = -$3;
        }
+       | tMONTH tUNUMBER tUNUMBER {
+           yyMonth = $1;
+           yyDay = $2;
+               yyYear = $3;
+       }
        | tMONTH tUNUMBER {
            yyMonth = $1;
            yyDay = $2;
diff --git a/ext/standard/tests/time/002.phpt b/ext/standard/tests/time/002.phpt
new file mode 100644 (file)
index 0000000..766af4d
--- /dev/null
@@ -0,0 +1,40 @@
+--TEST--
+strtotime() function
+--POST--
+--GET--
+--FILE--
+<?php
+       echo "1999-10-13\n";
+       echo strtotime ("1999-10-13")."\n";
+       echo strtotime ("Oct 13  1999")."\n\n";
+
+       echo "2000-01-19\n";
+       echo strtotime ("2000-01-19")."\n";
+       echo strtotime ("Jan 19  2000")."\n\n";
+
+       echo "2001-12-21\n";
+       echo strtotime ("2001-12-21")."\n";
+       echo strtotime ("Dec 21  2001")."\n\n";
+
+       echo "2001-12-21 12:16\n";
+       echo strtotime ("2001-12-21 12:16")."\n";
+       echo strtotime ("Dec 21 2001 12:16")."\n";
+       echo strtotime ("Dec 21  12:16")."\n";
+?>
+--EXPECT--
+1999-10-13
+939765600
+939765600
+
+2000-01-19
+948236400
+948236400
+
+2001-12-21
+1008889200
+1008889200
+
+2001-12-21 12:16
+1008933360
+1008933360
+-1