yyMeridian = $6;
}
| tUNUMBER ':' tUNUMBER ':' tUNUMBER tSNUMBER {
+ /* ISO 8601 format. hh:mm:ss[+-][0-9]{2}([0-9]{2})?. */
yyHour = $1;
yyMinutes = $3;
yySeconds = $5;
yyMeridian = MER24;
yyHaveZone++;
- yyTimezone = ($6 < 0
- ? -$6 % 100 + (-$6 / 100) * 60
- : - ($6 % 100 + ($6 / 100) * 60));
+ if ($6 < -100 || $6 > 100) {
+ yyTimezone = -$6 % 100 + (-$6 / 100) * 60;
+ } else {
+ yyTimezone = -$6 * 60;
+ }
}
;
--GET--
--FILE--
<?php
- putenv("TZ=GMT");
+ $dates = array (
+ "1999-10-13",
+ "Oct 13 1999",
+ "2000-01-19",
+ "Jan 19 2000",
+ "2001-12-21",
+ "Dec 21 2001",
+ "2001-12-21 12:16",
+ "Dec 21 2001 12:16",
+ "Dec 21 12:16",
+ "2001-10-22 21:19:58",
+ "2001-10-22 21:19:58-02",
+ "2001-10-22 21:19:58-0213",
+ "2001-10-22 21:19:58+02",
+ "2001-10-22 21:19:58+0213"
+ );
- echo "1999-10-13\n";
- echo strtotime ("1999-10-13")."\n";
- echo strtotime ("Oct 13 1999")."\n\n";
+ putenv ("TZ=GMT");
+ foreach ($dates as $date) {
+ echo date ("Y-m-d H:i:s\n", strtotime ($date));
+ }
- 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";
+ putenv ("TZ=Europe/Amsterdam");
+ foreach ($dates as $date) {
+ echo date ("Y-m-d H:i:s\n", strtotime ($date));
+ }
?>
--EXPECT--
-1999-10-13
-939772800
-939772800
-
-2000-01-19
-948240000
-948240000
-
-2001-12-21
-1008892800
-1008892800
-
-2001-12-21 12:16
-1008936960
-1008936960
--1
+1999-10-13 00:00:00
+1999-10-13 00:00:00
+2000-01-19 00:00:00
+2000-01-19 00:00:00
+2001-12-21 00:00:00
+2001-12-21 00:00:00
+2001-12-21 12:16:00
+2001-12-21 12:16:00
+1969-12-31 23:59:59
+2001-10-22 21:19:58
+2001-10-22 23:19:58
+2001-10-22 23:32:58
+2001-10-22 19:19:58
+2001-10-22 19:06:58
+1999-10-13 00:00:00
+1999-10-13 00:00:00
+2000-01-19 00:00:00
+2000-01-19 00:00:00
+2001-12-21 00:00:00
+2001-12-21 00:00:00
+2001-12-21 12:16:00
+2001-12-21 12:16:00
+1970-01-01 00:59:59
+2001-10-22 21:19:58
+2001-10-23 01:19:58
+2001-10-23 01:32:58
+2001-10-22 21:19:58
+2001-10-22 21:06:58