[local-time-devel] ENCODE-TIMESTAMP with a timezone

Daniel Lowe dlowe at bitmuse.com
Wed May 13 19:23:43 UTC 2009


Thomas Munro wrote:
> What do you think, is this useful?  Is the algorithm correct and
> is there a better one?  Would it be better to have two separate
> functions, one with the OFFSET and the other with the TIMEZONE?
> Does my LOOP syntax suck?

Hi, Thomas.

You can get the offset of a particular timezone with the timestamp-subtimezone
function, given a timestamp of the period you want.  If you want to start with a
sub-zone name, you can use:
 (subzone-offset (first
                   (gethash "CEST"
                     local-time::*abbreviated-subzone-name->timezone-list*)

Not the greatest solution, I know.  We should probably have a function similar
to timestamp-subtimezone that works with the name instead.

One of the design principles I've had in mind while making the local-time
library is that the complexity in time representations shouldn't be covered up
with half-solutions, so I'm afraid the patch isn't going to go in. I've actually
been planning to remove the guessing of the time offset entirely, defaulting to
UTC.  It's simply not meaningful, in the context of a timestamp, to have such an
ambiguity lying around.

The idea is that a timestamp is an unambiguous representation of a point in
time.  I'm still working on how to perform calculations with fuzzier time
definitions.  Sadly, I haven't been able to devote much time to it.

: Daniel :




More information about the local-time-devel mailing list