Implement support for time-zone information in decoded-time data
authorChris Hanson <org/chris-hanson/cph>
Wed, 24 Apr 1996 03:21:30 +0000 (03:21 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 24 Apr 1996 03:21:30 +0000 (03:21 +0000)
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).

v7/src/runtime/os2prm.scm
v7/src/runtime/runtime.pkg
v8/src/runtime/runtime.pkg

index 4bf6fd4d936cfcdb88fc347fcaa7073bc1ee4490..d29e09982451b23550fd9b4afa684de0d5e94a49 100644 (file)
@@ -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))
 \f
-(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))
 
index 17fbb24062ab1fd2c4f35e8b840a6d096ec9d25a..a7c177ff11cec0eba1d758b2a64839e98c7d9ee7 100644 (file)
@@ -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
index 88065533cc68378c772c754d196c80d52f183ec9..4b94a11477a8afb38bbd05db88bf2ae9f3ccd06d 100644 (file)
@@ -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