From: Derick Rethans Date: Sat, 27 Oct 2001 17:50:26 +0000 (+0000) Subject: - Fix for bugs #9640 and #13789 X-Git-Tag: ChangeLog~513 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6a5bcfef8dd182438fe91a9e1f332a46e2c38fa9;p=php - Fix for bugs #9640 and #13789 --- diff --git a/ext/standard/parsedate.y b/ext/standard/parsedate.y index 6cd7ba38d8..45357d9fbd 100644 --- a/ext/standard/parsedate.y +++ b/ext/standard/parsedate.y @@ -249,14 +249,17 @@ time : tUNUMBER tMERIDIAN { 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; + } } ; diff --git a/ext/standard/tests/time/002.phpt b/ext/standard/tests/time/002.phpt index 57325af4c4..eba00b074b 100644 --- a/ext/standard/tests/time/002.phpt +++ b/ext/standard/tests/time/002.phpt @@ -4,39 +4,59 @@ strtotime() function --GET-- --FILE-- --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