[Zope3-dev] Re: [Python-Dev] Holes in time
Aahz
aahz@pythoncraft.com
Wed, 1 Jan 2003 20:02:35 -0500
On Wed, Jan 01, 2003, Tim Peters wrote:
>
> This can't be glossed over. If you code a tzinfo class to take 1:MM as
> being standard time on that day instead, then the UTC hour 5:MM becomes
> unspellable in wall time instead. No matter how you cut it, the redundant
> spellings of an hour on the day DST starts means there's an hour that can't
> be spelled at all on the day DST ends (so in that sense, they're the two
> sides of a single problem).
>
> What to do? The current implementation of dt.astimezone(tz) raises
> ValueError if dt can't be expressed as a local time in tz. That's the
> "errors should never pass silently" school, which I briefly attended in
> college <wink>. If you don't like that, what would you rather see happen?
> Try to be precise, and remember that getting a "correct" time in tz is
> flatly impossible in this case.
What exactly do you mean by "wall time"? Is it supposed to be a
timezone-less value? If yes, you can't convert between wall time and
any timezone-based value without specifying the time zone the wall clock
lives in, which has to be relative to UTC. This only becomes a serious
problem for round-trip conversions. Does it make any sense to include a
flag if a time value ever gets converted between wall time and any other
kind of time? Every other datetime package seems to live with the
wiggle involved in round-trip conversions, why not Python?
--
Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/
"There are three kinds of lies: Lies, Damn Lies, and Statistics." --Disraeli