modin.pandas.Series.dt.tz_convert¶
- Series.dt.tz_convert[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.47.0/.tox/docs/lib/python3.9/site-packages/modin/pandas/series_utils.py#L747-L750)¶
Convert tz-aware Datetime Array/Index from one time zone to another.
- Parameters:
tz (str, pytz.timezone, dateutil.tz.tzfile, datetime.tzinfo or None) – Time zone for time. Corresponding timestamps would be converted to this time zone of the Datetime Array/Index. A tz of None will convert to UTC and remove the timezone information.
- Return type:
Array or Index
- Raises:
TypeError – If Datetime Array/Index is tz-naive.
See also –
DatetimeIndex.tz – A timezone that has a variable offset from UTC.
DatetimeIndex.tz_localize – Localize tz-naive DatetimeIndex to a given time zone, or remove timezone from a tz-aware DatetimeIndex.
Examples
With the tz parameter, we can change the DatetimeIndex to other time zones:
With the tz=None, we can remove the timezone (after converting to UTC if necessary):