[Zope3-dev] The Date Time and TimeZone question

Tim Peters tim@zope.com
Sat, 16 Mar 2002 13:29:37 -0500


[Guido]
> ...
> In my design, it stores the date and time AS THE CLOCKS IN THAT
> TIMEZONE WOULD SHOW.  This makes displaying the time easier.

> ...
> In my view, design, the add/subtract code can be ignorant of the
> specific rules implemented by the tzinfo object used -- it does its
> computation on the broken-out fields (which, as I said, are stored in
> the tzinfo object's local time) and simply gives the result the same
> tzinfo object as the source.
> ...

> ...
> No, that's not how it works.  In my design, 1 day is exactly
> equivalent to 24 hours.

If I put those all together, I don't understand what answer this gives to
the original dilemma at:

    http://www.zope.org/Members/fdrake/DateTimeWiki/NaiveTime

That is, if I add "a day" to 12 noon on April 6, 2002, with a tzinfo object
for our favorite time zone. the rules above seem clearly to say that the
result is a datetime object for 12 noon on April 7, 2002, with the same
tzinfo object attached.  But the tzinfo object has no way to know how that
datetime was computed, and in particular can't know whether it was entered
directly or was the result of adding "a day" to noon of the previous day.
How then could a chemical plant operator code a tzinfo object that "did the
right thing" here, i.e. told them to shut down the 24-hour reaction at 1 pm
on April 7, 2002?