[Zope3-checkins] CVS: Zope3/src/datetime - _datetime.py:1.23
Tim Peters
tim.one@comcast.net
Mon, 20 Jan 2003 17:13:36 -0500
Update of /cvs-repository/Zope3/src/datetime
In directory cvs.zope.org:/tmp/cvs-serv11550/src/datetime
Modified Files:
_datetime.py
Log Message:
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.
=== Zope3/src/datetime/_datetime.py 1.22 => 1.23 ===
--- Zope3/src/datetime/_datetime.py:1.22 Wed Jan 8 15:18:23 2003
+++ Zope3/src/datetime/_datetime.py Mon Jan 20 17:13:02 2003
@@ -1316,6 +1316,10 @@
return other
another = other + otdst
+ return another
+
+ # XXX Leaving this unreachable code here for a while. It may be
+ # XXX needed again real soon <wink>.
anotherdst = another.dst()
if anotherdst is None:
self._inconsistent_dst()