python - How do I get .to_datetime() to stop offsetting by UTC in string -


this question has answer here:

i'm converting timestamp given string .csv file. in format:

2016-06-06t09:30:00.000856632-04:00 

when use .to_datetime() convert date object, offsets utc time. in example, 9:30am becomes 1:30pm:

2016-06-06 13:30:00.000856632 

i read documentation function , thought setting utc = false parameter fix offsets time different amount.

the string has -4 hours offset. remove before conversion:

>>> pd.to_datetime("2016-06-06t09:30:00.000856632-04:00"[:-6]) timestamp('2016-06-06 09:30:00.000856632') 

Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -