Created
January 23, 2018 23:21
-
-
Save wesm/56e9acee120b0af60391b54245e03c31 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [1]: import pandas as pd | |
In [2]: ts = pd.Timestamp('2000-01-01 00:00:00') | |
In [3]: ts | |
Out[3]: Timestamp('2000-01-01 00:00:00') | |
In [4]: ts.hour | |
Out[4]: 0 | |
In [5]: ts.value | |
Out[5]: 946684800000000000 | |
In [6]: ts_nyc = ts.tz_localize('America/New_York') | |
In [7]: ts_nyc | |
Out[7]: Timestamp('2000-01-01 00:00:00-0500', tz='America/New_York') | |
In [8]: ts_nyc.hour | |
Out[8]: 0 | |
In [9]: ts_nyc.value | |
Out[9]: 946702800000000000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment