From: Chris Hanson Date: Wed, 24 Apr 1996 03:21:30 +0000 (+0000) Subject: Implement support for time-zone information in decoded-time data X-Git-Tag: 20090517-FFI~5574 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=11ab0cd090bd9800da57ed390fd32e9d1623bb0f;p=mit-scheme.git Implement support for time-zone information in decoded-time data type. Generalize the procedure FILE-TIME->STRING so that it generates an RFC-822 time string (when time-zone information is available from the microcode). --- diff --git a/v7/src/runtime/os2prm.scm b/v7/src/runtime/os2prm.scm index 4bf6fd4d9..d29e09982 100644 --- a/v7/src/runtime/os2prm.scm +++ b/v7/src/runtime/os2prm.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: os2prm.scm,v 1.24 1995/10/31 08:05:02 cph Exp $ +$Id: os2prm.scm,v 1.25 1996/04/24 03:21:30 cph Exp $ Copyright (c) 1994-95 Massachusetts Institute of Technology @@ -110,31 +110,6 @@ MIT in each case. |# access-time modification-time)) -(define (file-time->string time) - ;; The returned string is in the format specified by RFC 822, - ;; "Standard for the Format of ARPA Internet Text Messages". - (let ((dt (decode-file-time time)) - (d2 (lambda (n) (string-pad-left (number->string n) 2 #\0)))) - (string-append (day-of-week/short-string (decoded-time/day-of-week dt)) - ", " - (number->string (decoded-time/day dt)) - " " - (month/short-string (decoded-time/month dt)) - " " - (number->string (decoded-time/year dt)) - " " - (d2 (decoded-time/hour dt)) - ":" - (d2 (decoded-time/minute dt)) - ":" - (d2 (decoded-time/second dt)) - " " - (time-zone->string - (let ((tz (local-time-zone))) - (if (decoded-time/daylight-savings-time? dt) - (- tz 1) - tz)))))) - (define (local-time-zone) (/ ((ucode-primitive os2-time-zone 0)) 3600)) diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index 17fbb2406..a7c177ff1 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.266 1996/04/05 22:46:49 cph Exp $ +$Id: runtime.pkg,v 14.267 1996/04/24 03:21:08 cph Exp $ Copyright (c) 1988-96 Massachusetts Institute of Technology @@ -378,6 +378,7 @@ MIT in each case. |# day-of-week/long-string day-of-week/short-string decode-universal-time + decoded-time->string decoded-time/date-string decoded-time/day decoded-time/day-of-week @@ -388,7 +389,9 @@ MIT in each case. |# decoded-time/second decoded-time/time-string decoded-time/year + decoded-time/zone encode-universal-time + file-time->string get-decoded-time get-universal-time make-decoded-time @@ -396,7 +399,8 @@ MIT in each case. |# month/max-days month/short-string time-zone->string - time-zone?)) + time-zone? + universal-time->string)) (define-package (runtime debugger) (files "debug") @@ -1407,7 +1411,6 @@ MIT in each case. |# imag-part inexact->exact inexact? - int:->flonum integer-ceiling integer-divide integer-divide-quotient diff --git a/v8/src/runtime/runtime.pkg b/v8/src/runtime/runtime.pkg index 88065533c..4b94a1147 100644 --- a/v8/src/runtime/runtime.pkg +++ b/v8/src/runtime/runtime.pkg @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.267 1995/11/13 07:22:06 cph Exp $ +$Id: runtime.pkg,v 14.268 1996/04/24 03:21:18 cph Exp $ -Copyright (c) 1988-95 Massachusetts Institute of Technology +Copyright (c) 1988-96 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -373,6 +373,7 @@ MIT in each case. |# day-of-week/long-string day-of-week/short-string decode-universal-time + decoded-time->string decoded-time/date-string decoded-time/day decoded-time/day-of-week @@ -383,7 +384,9 @@ MIT in each case. |# decoded-time/second decoded-time/time-string decoded-time/year + decoded-time/zone encode-universal-time + file-time->string get-decoded-time get-universal-time make-decoded-time @@ -391,7 +394,8 @@ MIT in each case. |# month/max-days month/short-string time-zone->string - time-zone?)) + time-zone? + universal-time->string)) (define-package (runtime debugger) (files "debug") @@ -1404,7 +1408,6 @@ MIT in each case. |# imag-part inexact->exact inexact? - int:->flonum integer-ceiling integer-divide integer-divide-quotient