Convert timezone-aware Timestamp to another time zone.
Time zone for time which Timestamp will be converted to. None will remove timezone holding UTC time.
If Timestamp is tz-naive.
Examples
Create a timestamp object with UTC timezone:
>>> ts = pd.Timestamp('2020-03-14T15:32:52.192548651', tz='UTC') >>> ts Timestamp('2020-03-14 15:32:52.192548651+0000', tz='UTC')
Change to Tokyo timezone:
>>> ts.tz_convert(tz='Asia/Tokyo') Timestamp('2020-03-15 00:32:52.192548651+0900', tz='Asia/Tokyo')
Can also use astimezone
:
>>> ts.astimezone(tz='Asia/Tokyo') Timestamp('2020-03-15 00:32:52.192548651+0900', tz='Asia/Tokyo')
Analogous for pd.NaT
:
>>> pd.NaT.tz_convert(tz='Asia/Tokyo') NaT
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4