Skip to content

Instantly share code, notes, and snippets.

View boskaiolo's full-sized avatar

Alberto Boschetti boskaiolo

View GitHub Profile
>>> import pandas
>>> timestamp = '2019–10–20 18:23:36.223344–04
>>> pd.Timestamp(timestamp)
Timestamp('2019–10–20 18:23:36.223344–0400', tz='pytz.FixedOffset(-240)')
>>> timestamp_utc = pd.Timestamp(timestamp).astimezone('utc')
>>> timestamp_utc
Timestamp('2019–10–20 22:23:36.223344+0000', tz='UTC')