From 43cfdb9c2fca6054e1537350b95541c0852d4dc4 Mon Sep 17 00:00:00 2001 From: ram <ram> Date: Fri, 14 Dec 1990 19:13:12 +0000 Subject: [PATCH] Fixed FORMAT-UNIVERSAL-TIME to not call DECODE-UNIVERSAL-TIME with a NIL timezone arg, thus resulting in some undesirable type inferences. --- code/format-time.lisp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/code/format-time.lisp b/code/format-time.lisp index e57d2b371..730ad179b 100644 --- a/code/format-time.lisp +++ b/code/format-time.lisp @@ -73,11 +73,15 @@ (unless (integerp universal-time) (error "~A: Universal-Time should be an integer." universal-time)) (when timezone - (unless (and (integerp timezone) (<= 0 timezone 32)) - (error "~A: Timezone should be an integer between 0 and 32." - timezone))) + (unless (and (rationalp timezone) (<= -24 timezone 24)) + (error "~A: Timezone should be a rational between -24 and 24." timezone)) + (unless (zerop (rem timezone 1/3600)) + (error "~A: Timezone is not a second (1/3600) multiple." timezone))) + (multiple-value-bind (secs mins hours day month year dow dst tz) - (decode-universal-time universal-time timezone) + (if timezone + (decode-universal-time universal-time timezone) + (decode-universal-time universal-time)) (declare (ignore dst) (fixnum secs mins hours day month year dow)) (let ((time-string "~2,'0D:~2,'0D") (date-string -- GitLab