[local-time-devel] Timestamp encoding incorrect

Harry Bock harry at oshean.org
Mon Jul 20 18:25:08 UTC 2009


Hi,

I've found an odd issue with manipulating and generating timestamps using
LOCAL-TIME. For example, when trying to encode January 1, 2009 as a
timestamp, I get the following results in SBCL:

PERISCOPE> (encode-timestamp 0 0 0 0 1 1 2009)
@2008-12-31T23:00:00.000000-05:00

Decoding this result is similarly wrong:
PERISCOPE> (decode-timestamp (encode-timestamp 0 0 0 0 1 1 2009) )
0

0

0

23

31

12

2008

3

NIL

-18000

"EST"

I get other, similar weirdness when adding to timestamps, like so:
PERISCOPE> (timestamp-minimize-part * :day)
@2009-11-01T00:00:00.000000-04:00
PERISCOPE> (timestamp+ * 1 :month)
@2009-11-30T23:00:00.000000-05:00

Is this the expected behavior?

Harry

-- 
Harry Bock
Software Developer, Package Maintainer
OSHEAN, Inc.
Email: harry at oshean.org
PGP Key ID: 546CC353
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/local-time-devel/attachments/20090720/72b62a3c/attachment.html>


More information about the local-time-devel mailing list