From: Taylor R Campbell Date: Tue, 7 Dec 2010 23:37:59 +0000 (+0000) Subject: Fix datime.scm's time formats to accept up to 61 seconds in a minute. X-Git-Tag: 20101212-Gtk~9 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=d3d4cb64f539012799669caf6c2c3e71d60b1325;p=mit-scheme.git Fix datime.scm's time formats to accept up to 61 seconds in a minute. Minutes in any UTC-based time system, which covers every system of which representations are parsed in datime.scm, can have 59, 60, or 61 seconds; previously we refused to parse representations of the 61st second. Unfortunately, our notion of `universal time' is still essentially Common Lisp's ill-specified notion of universal time, and implemented by POSIX's mind-bogglingly brain-damaged notion of `number of seconds since the Epoch' which actually means `number of seconds since the Epoch, minus the number of them that were leap seconds in UTC'. --- diff --git a/src/runtime/datime.scm b/src/runtime/datime.scm index 08752f971..28e9c0d02 100644 --- a/src/runtime/datime.scm +++ b/src/runtime/datime.scm @@ -113,7 +113,7 @@ USA. (check-range day 1 (month/max-days month)) (check-range hour 0 23) (check-range minute 0 59) - (check-range second 0 59))) + (check-range second 0 60))) (define (compute-day-of-week day month year) ;; This implements Zeller's Congruence. @@ -334,7 +334,7 @@ USA. (define parse-rfc2822-year (number-parser 4 4 1900 9999)) (define parse-rfc2822-hour (number-parser 2 2 0 23)) (define parse-rfc2822-minute (number-parser 2 2 0 59)) -(define parse-rfc2822-second (number-parser 2 2 0 59)) +(define parse-rfc2822-second (number-parser 2 2 0 60)) (define match-lws (*matcher (+ (char-set char-set:wsp)))) @@ -507,7 +507,7 @@ USA. (define parse-ctime-hour (number-parser 2 2 0 23)) (define parse-ctime-minute (number-parser 2 2 0 59)) -(define parse-ctime-second (number-parser 2 2 0 59)) +(define parse-ctime-second (number-parser 2 2 0 60)) (define parse-ctime-day1 (number-parser 1 1 1 9)) (define parse-ctime-day2 (number-parser 2 2 10 31)) (define parse-ctime-year (number-parser 4 4 1900 9999)) @@ -827,7 +827,7 @@ USA. (define parse-8601-hour (number-parser 2 2 0 24)) (define parse-8601-zone-hour (number-parser 2 2 0 24)) (define parse-8601-minute (number-parser 2 2 0 59)) -(define parse-8601-second (number-parser 2 2 0 59)) +(define parse-8601-second (number-parser 2 2 0 60)) (define parse-8601-sign (*parser @@ -864,7 +864,7 @@ USA. (define parse-rfc850-day (number-parser 2 2 1 31)) (define parse-rfc850-hour (number-parser 2 2 0 23)) (define parse-rfc850-minute (number-parser 2 2 0 59)) -(define parse-rfc850-second (number-parser 2 2 0 59)) +(define parse-rfc850-second (number-parser 2 2 0 60)) ;;;; Utilities