[Zope3-dev] Re: [Python-Dev] Holes in time

M.-A. Lemburg mal@lemburg.com
Mon, 06 Jan 2003 11:22:58 +0100


Tim Peters wrote:
> Half the
> words there are explaining the edge cases and what we want to do when we see
> one, and so are resuable.  BTW, the analytic proof is about three times as
> long as it needs to be, because it explains each tiny step in detail.  More
> typical would be something like
> 
> Let y = x but in tz's time zone.
> Let z = y - x.o + y.s.

Care to explain what .o, .n and .s mean for the casual reader ;-)

> Then diff = (x.n - x.o) - (z.n - z.o) =
>             x.n - x.o - y.n + x.o - y.s + z.o =
>             z.o - y.s =
>             z.d
> 
> We're done iff z.d = 0, and if it is then we have the std time spelling we
> want in the start-of-DST case.
> 
> Else let z' = z + z.d.
> 
> Then diff' = (x.n - x.o) - (z'.n - z'.o) =
>              x.n - x.o - z.n - x.n + x.o + z.n - z.o + z'.o =
>              z'.o - z.o =
>              z'.d - z.d
> 
> So now we're done iff z'.d = z.d.  If not, we must be in the end-of-DST case
> (there is no UTC equivalent to x in tz's local time), so we want z (in
> daylight time) instead of z' (in std time for most realistic time zones, but
> perhaps in a different branch of double-daylight time -- figuring out
> exactly how it can be that z'.d != z.d at this point is an example of the
> analytic method forcing assumptions into the open).

I think you are missing a point here: time zones don't have DST.

Each time zone describes a fixed offset from UTC and whenever
the locale applies DST, the time zone for that locale switches
to a new time zone, e.g. MET becomes MEST. The disruption you are
seeing at the DST switch times comes from switching the time zone
and is not caused by the locale's clocks doing a "jump" like in a
Feynman diagram.

-- 
Marc-Andre Lemburg
CEO eGenix.com Software GmbH
_______________________________________________________________________
eGenix.com -- Makers of the Python mx Extensions: mxDateTime,mxODBC,...
Python Consulting:                               http://www.egenix.com/
Python Software:                    http://www.egenix.com/files/python/