Why are timezone aware and naive datetimes not distinct classes?

Roy Smith roy at panix.com
Sat Mar 9 20:40:14 CET 2013


In article <pan.2013.03.09.19.14.59.699000 at nowhere.com>,
 Nobody <nobody at nowhere.com> wrote:

> The distinction may actually matter for times in the far future, as you
> can't reliably predict how or when timezone defintions will change.

Sadly, this is true.

> For this reason, "appointments" should always be
> kept in local time, so that you don't get errors if the timezone rules
> (or the timezone) change between the time an appointment is made and the
> time it occurs.

Well, sort of.  Future scheduled activities (which I assume is what you 
mean by "appointments") should be kept in whatever timezone makes sense 
for that activity.  For example, I'm on NASA's mailing list to receive 
alerts when the ISS is going to be visible to the naked eye at my 
location.  The last one said:

> Time: Wed Feb 27 6:17 PM, Visible: 4 min, Max Height: 54 degrees, 
> Appears: W, Disappears: SE

If I wanted to put that on my calendar, I really should convert it to 
UTC and record it that way.  If the folks who mess with these things 
were to suddenly decide to move when DST starts, the space station isn't 
going to adjust its orbit to accommodate that.

Likewise, let's say I make an appointment to have a phone call with 
somebody in Caliornia (I'm in New York) at some future date.  I put on 
my calendar "Call with Joe, 5 PM".  Joe puts on his, "Call with Roy, 2 
PM".  The idiots in Albany and/or Sacramento decide to mess with the 
timezones and one state changes the rules.  We're going to miss our 
phone call.  Had we both recorded the arranged time in UTC, we'd get to 
talk to each other.



More information about the Python-list mailing list