views:

123

answers:

1

I have tried this but its not correct:

In [34]: e_now
Out[34]: datetime.datetime(2010, 2, 17, 0, 2, 40, 506444, tzinfo=<DstTzInfo 'US/Eastern' EST-1 day, 19:00:00 STD>)

In [35]: e_now.utcoffset()
Out[35]: datetime.timedelta(-1, 68400)
A: 

The tzinfo is identified as EST-1 day, 19:00:00 -- and the timedelta is given as -1 day, 68400 seconds (i.e., 19 hours, just as in the tzinfo identification). All timezones east of the London-Paris meridian will have -1 day and a positive number of seconds: for example, when it's a second past midnight in London (UTC), it's 1 second past 7pm (that is, 19:00) of the previous calendar day in New York. Why do you think that's a problem?

Alex Martelli
I was miss reading the response this is correct. I hoping for something link timedelta(hours=-5)
Vitaly Babiy
But I can do it with something like: (delta.days * 86400 + delta.seconds) / 60 / 60
Vitaly Babiy