[docs] "sane" tzinfo subclasses
paulkoning at comcast.net
Mon Sep 19 03:04:16 CEST 2011
Section 8.1.6 of the library manual talks about utcoffset(dt)-dst(dt) as the "standard offset" and says that this should not depend on the date or time but only on the location.
That seems to assume that the politicians who change timezone rules only change the times when DST is in effect, but don't meddle with the standard offset. Often that is true, at least so long as you don't go all that far into the past. But not always. Consider Venezuela, which changed from standard offset -4:00 to -4:30 in 2007, or Samoa, which is changing from -11:00 to +13:00 end of this year. For that matter, various parts of Indiana seem to be switching from time to time, as recently as a couple of years ago.
Admittedly this is not all that sane, but then again it's politics. If datetime.astimezone() relies on this assumption when it's clearly not always satisfied, what goes wrong?
See the Olson database for all the gory details; the examples I quoted all can be found in there.
More information about the docs