[Zope3-dev] Can we remove ZopeLegacy for now?

Patrick K. O'Brien pobrien@orbtech.com
Fri, 15 Mar 2002 14:30:58 -0600


>
> +1 on naive time. :-)
>
> The calculation that should happen when adding 24 hours depends not only
> on the time zone offset but also the time zone *name*.  "EST" always
> means GMT-5, "EDT" always means GMT-4, and "US/Eastern" means either
> GMT-5 or GMT-4 depending on the date.  So 12:00 on April 6, 2002 EST,
> plus 24 hours, is 12:00 on April 7, 2002 EST (which doesn't actually
> occur), while 12 noon on April 6, 2002 US/Eastern, plus 24 hours, is
> 13:00 on April 7, 2002 US/Eastern.  And like you said, if you add a day
> instead of 24 hours, the rules are different.
>
> No matter what you do, you're not going to please everyone, since so
> many think that the calculation they want is what everyone else wants,
> and that's just not the case.  I know this from experience in trying to
> maintain time zone support in Zope's DateTime.  Let's simplify.

Aren't the number of ways to calculate this a finite set? Maybe I'm just
being stubborn out of ignorance. But I just can't see why the complexity
can't be reduced to a small number of cases. Then we either pick the single
case that we want to support (which, like you say, won't please everyone) or
we have some way to toggle the calculation among the 3 or 4 cases and please
everyone. If people deal with this issue in real life, on paper and in their
heads, why can't we deal with it in a datatype?

Would it help any to store the basic timezone (25 timezones that ignore DST,
like GMT) separate from some kind of DST boolean/offset (assuming DST is
always a one hour offset)? So we would never store "EDT", we would instead
store "EST" with DST as True, or as GMT-5 with DST as True. Then local time
would be the basic timezone plus the DST. Syntactic sugar-coating could
display "EST" with DST == 1 as "EDT".

The toggle then just becomes whether or not to include/exclude an extra hour
in certain calculations where one datetime DST is False and the other's DST
is True. Or when a datetime plus a delta results in a different DST than the
original.

I realize I know a lot less about this issue than I should. And I apologize
if it is annoying. But I feel like the clock is ticking (no pun intended)
and now is the time to be involved, before everything is decided. I'm doing
my best to research the issue and I'm serious about writing unit tests for
any prototypes. If anyone can point me to more material I should be looking
at I will be glad to do so. Thanks for listening.

---
Patrick K. O'Brien
Orbtech