S
Skip Montanaro
Following up on my earlier note about UTC v. GMT, I am having some
trouble grokking attempts to convert a datetime into UTC. Consider
these three values:
datetime.datetime(2014, 1, 29, 15, 39, 35, 263666)
All well and good, right? The variable "now" is a naive datetime
object. I happen to be sitting in a chair in the city of Chicago, so
let's call it what it is, a datetime in the America/Chicago timezone:
datetime.datetime(2014, 1, 29, 15, 39, 35, 263666, tzinfo=<DstTzInfo
'America/Chicago' CST-1 day, 18:00:00 STD>)
That looks good to me. Now, let's normalize it to UTC:
15
WTF? Why isn't the t.hour == 21?
Okay, let's see what GMT does for us:
21
That looks correct, but I don't understand why I don't get hour==21
out of the UTC.normalize call. It's like it's a no-op.
Skip
trouble grokking attempts to convert a datetime into UTC. Consider
these three values:
datetime.datetime(2014, 1, 29, 15, 39, 35, 263666)
All well and good, right? The variable "now" is a naive datetime
object. I happen to be sitting in a chair in the city of Chicago, so
let's call it what it is, a datetime in the America/Chicago timezone:
datetime.datetime(2014, 1, 29, 15, 39, 35, 263666, tzinfo=<DstTzInfo
'America/Chicago' CST-1 day, 18:00:00 STD>)
That looks good to me. Now, let's normalize it to UTC:
15
WTF? Why isn't the t.hour == 21?
Okay, let's see what GMT does for us:
21
That looks correct, but I don't understand why I don't get hour==21
out of the UTC.normalize call. It's like it's a no-op.
Skip