From: Chris Hanson Date: Sat, 4 May 1996 17:30:08 +0000 (+0000) Subject: Fix bug: encoding times with time-zone information was not scaling the X-Git-Tag: 20090517-FFI~5551 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=1000242e715546acf722474a708a869682e30e2f;p=mit-scheme.git Fix bug: encoding times with time-zone information was not scaling the time-zone information to seconds as expected by the microcode. --- diff --git a/v7/src/runtime/datime.scm b/v7/src/runtime/datime.scm index 302ae711e..9d25698cd 100644 --- a/v7/src/runtime/datime.scm +++ b/v7/src/runtime/datime.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: datime.scm,v 14.13 1996/04/24 03:22:03 cph Exp $ +$Id: datime.scm,v 14.14 1996/05/04 17:30:08 cph Exp $ Copyright (c) 1988-96 Massachusetts Institute of Technology @@ -49,7 +49,8 @@ MIT in each case. |# (named decoded-time-structure-tag) (conc-name decoded-time/) (constructor %make-decoded-time) - (constructor allocate-decoded-time ())) + (constructor allocate-decoded-time ()) + (copier)) (second #f read-only #t) (minute #f read-only #t) (hour #f read-only #t) @@ -91,7 +92,12 @@ MIT in each case. |# result)) (define (encode-universal-time dt) - ((ucode-primitive encode-time 1) dt)) + ((ucode-primitive encode-time 1) + (if (decoded-time/zone dt) + (let ((dt* (copy-decoded-time dt))) + (set-decoded-time/zone! dt* (* (decoded-time/zone dt*) 3600)) + dt*) + dt))) (define (get-universal-time) ((ucode-primitive encoded-time 0)))