From 2f6be8ec6a35b23d174e41d5b0aa3472337fde3b Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sun, 23 Apr 1995 05:53:47 +0000 Subject: [PATCH] Add day-of-week prefix to string returned by FILE-TIME->STRING. At this point, the returned string is fully compliant with RFC 822. Furthermore, the procedure is not operating-system specific, except that it calls the procedure LOCAL-TIME-ZONE, which isn't currently defined for any other operating system. Offhand, it's not obvious what's involved in implementing LOCAL-TIME-ZONE for other systems, except for the more modern unix systems, in which it's trivial. --- v7/src/runtime/os2prm.scm | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/v7/src/runtime/os2prm.scm b/v7/src/runtime/os2prm.scm index a1f3a98aa..d75e08d79 100644 --- a/v7/src/runtime/os2prm.scm +++ b/v7/src/runtime/os2prm.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: os2prm.scm,v 1.16 1995/04/23 05:24:01 cph Exp $ +$Id: os2prm.scm,v 1.17 1995/04/23 05:53:47 cph Exp $ Copyright (c) 1994-95 Massachusetts Institute of Technology @@ -105,9 +105,13 @@ MIT in each case. |# 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 (number->string (decoded-time/day dt)) + (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)) " " @@ -132,16 +136,11 @@ MIT in each case. |# (ucode-primitive os2-daylight-savings-time? 0)) (define (decode-file-time time) - (let* ((twosecs (remainder time 32)) - (time (quotient time 32)) - (minutes (remainder time 64)) - (time (quotient time 64)) - (hours (remainder time 32)) - (time (quotient time 32)) - (day (remainder time 32)) - (time (quotient time 32)) - (month (remainder time 16)) - (year (quotient time 16))) + (let* ((twosecs (remainder time 32)) (time (quotient time 32)) + (minutes (remainder time 64)) (time (quotient time 64)) + (hours (remainder time 32)) (time (quotient time 32)) + (day (remainder time 32)) (time (quotient time 32)) + (month (remainder time 16)) (year (quotient time 16))) (make-decoded-time (* twosecs 2) minutes hours day month (+ 1980 year)))) (define (encode-file-time dt) -- 2.25.1