]> granicus.if.org Git - python/commit
New rule for tzinfo subclasses handling both standard and daylight time:
authorTim Peters <tim.peters@gmail.com>
Mon, 20 Jan 2003 22:54:38 +0000 (22:54 +0000)
committerTim Peters <tim.peters@gmail.com>
Mon, 20 Jan 2003 22:54:38 +0000 (22:54 +0000)
commit327098a613924b4c06e6d79018881aad7939261e
tree3e6a711d6ab2313bdef80012909de3e3a0769ff1
parent4440f22e987f2ccfb798eb8df349884082cccb64
New rule for tzinfo subclasses handling both standard and daylight time:
When daylight time ends, an hour repeats on the local clock (for example,
in US Eastern, the clock jumps from 1:59 back to 1:00 again).  Times in
the repeated hour are ambiguous.  A tzinfo subclass that wants to play
with astimezone() needs to treat times in the repeated hour as being
standard time.  astimezone() previously required that such times be
treated as daylight time.  There seems no killer argument either way,
but Guido wants the standard-time version, and it does seem easier the
new way to code both American (local-time based) and European (UTC-based)
switch rules, and the astimezone() implementation is simpler.
Doc/lib/libdatetime.tex
Doc/lib/tzinfo-examples.py
Lib/test/test_datetime.py
Modules/datetimemodule.c