[local-time-devel] Error in range of offset value returned from decode-timestamp

Huw Giddens huw at robotines.co.nz
Sun Jan 4 13:42:47 UTC 2009


The offset value returned from decode-timestamp is declaimed as having  
the type (integer -43199 43199). However, there exist time zones with  
offsets outside this range; the Pacific/Auckland time zone is one that  
does, with the offset being +12 hours (43200 seconds) outside DST and  
+13 hours (46800 seconds) inside. Pacific/Kiritimati lies even further  
outside at +14 hours.

It's pretty trivial to hack the source here to expand the declaimed  
range to something closer to the actual range of time zone offsets,  
but I'm just curious if there's a reason the range was so small, and  
what I'm liable to break by expanding it.

Here's a REPL transcript showing a way to reproduce the error.

* (in-package :local-time)
#<PACKAGE "LOCAL-TIME">
* (reread-timezone-repository)
* (setf *default-timezone* (find-timezone-by-location-name "Australia/ 
Brisbane"))
#<TIMEZONE EST EST EST EST>
* (now)
@2009-01-04T23:23:07.098264+10:00
* (setf *default-timezone* (find-timezone-by-location-name "Pacific/ 
Auckland"))
#<TIMEZONE NZST NZMT NZST NZDT NZST NZST>
* (now)
@
debugger invoked on a TYPE-ERROR in thread #<THREAD "initial thread"  
RUNNING {1191F7E1}>:
   The value 46800 is not of type (INTEGER -43199 43199).

Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
   0: [ABORT] Exit debugger, returning to top level.

(DECODE-TIMESTAMP #<error printing object>)[:EXTERNAL]
0]





More information about the local-time-devel mailing list