[local-time-devel] TIMESTAMP+ doesn't work correcly when adding months

Attila Lendvai attila.lendvai at gmail.com
Wed Apr 8 07:43:16 UTC 2009


> There seems to be a bug in TIMESTAMP+ -- it doesn't work correctly while
> adding months. e.g.
>
> (local-time:timestamp+ (local-time:encode-timestamp 0 0 0 0 1 3 2009) 1
> :month)
> => @2009-03-29T00:00:00.000000+05:30

try this (notice the :offset 0):

(local-time:timestamp+ (local-time:encode-timestamp 0 0 0 0 1 3 2009
:offset 0) 1 :month)
=> @2009-04-01T02:00:00.000000+02:00

the problem is that there's no proper support for dates yet, and a
timestamp will never behave intentional when it's used as a date.

it's on our (cl-dwim guys) TODO, and Daniel (l-t 's author) even wrote
up an implementation plan. i think the general conclusion is that the
Java lib called Joda has the right ideas about dates and partial
timestamps.

but i'm personally lacking both the time and a clear vision on how it
should work (although it's related, because if one knows how it should
work then typing it up shouldn't be more than a day, including tests).

any volunteers? :)

-- 
 attila




More information about the local-time-devel mailing list