UTC "timezone" causing brain explosions

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top