I know that sometimes when you're converting between timezones Python gets confused about what the result should be, because timezones are hard.
from pandas import Timestamp
string = "1900-01-01 00:00:00"
ts = Timestamp(string, tz='US/Eastern')
print(ts)
Timestamp('1900-01-01 00:00:00-0456', tz='US/Eastern')
Obviously the offset should not be four hours and 56 minutes.
When it gets it wrong, is there a way to insist on what you the utcoffset
should be?
I'm only converting between 'US/Eastern' and 'UTC', so the offset should only ever be four or five hours. What I'd like to do is check to see if the offset is an integer number of hours, and then round to the nearest number if not.