[local-time-devel] [PATCH] Make local-time operate correctly with timezones

Attila Lendvai attila.lendvai at gmail.com
Fri Oct 2 08:09:33 UTC 2009


> We have (together with Maciej Katafiasz) been working on making
> local-time work correctly with regard to timezones. The changes are
> quite extensive, but it seems to give correct results now in about
> every operation we could think of. That includes overflowing into or
> from DST. To achieve that we had to add timezone/offset arguments to
> several functions. The biggest changes are in the ADJUST-TIMESTAMP
> helper functions (%OFFSET-TIMESTAMP-PATY and %SET-TIMESTAMP-PART).
> Additionally we corrected the rather schizophrenic nature of
> WITH-DECODED-TIMESTAMP, which took timezone but not offset, unlike
> everything else.
>
> The changes are API compatible, so there shouldn't be any breakage to
> existing code. The semantics did change, but as far as we can tell the
> old semantics were buggy, so it's unlikely that any client would want
> them this way. Note that the changes include the patch from Thomas
> Munro to ENCODE-TIMESTAMP, together with the DST ambiguity. That
> ambiguity carries over to ADJUST-TIMESTAMP when used with symbolic
> arguments (month and year) but not the precise ones i.e. nsec, sec,
> day, hour, minute. If you don't like the ambiguity and have a good
> idea how to solve it, we'll be glad to implement that. But personally
> we think it's fine simply to document that explicitly.
>
> Below is a simple test suite that fails in the upstream version but
> works fine with our changes. It's by no means exhaustive, but it does
> touch most of the interesting cases.


i've been using these patches for a while locally and recently pushed
them to the official repo.

i did not go through a deep code review, but this patch seems to be
worth much more than letting it rest on a mailing list. if it breaks
something then please speak up, or even better just send fixes! :)

thanks,

-- 
 attila




More information about the local-time-devel mailing list