pandas.DatetimeIndex.tz#
- property DatetimeIndex.tz[source]#
Return the timezone.
This property returns the timezone information associated with the DatetimeIndex. If the data is timezone-naive (i.e. has no timezone information), it returns None.
- Returns:
- zoneinfo.ZoneInfo, datetime.tzinfo, pytz.tzinfo.BaseTZInfo, dateutil.tz.tz.tzfile, or None
Returns None when the DatetimeIndex is tz-naive.
See also
DatetimeIndex.tz_localizeLocalize tz-naive DatetimeIndex to a given time zone, or remove timezone from a tz-aware DatetimeIndex.
DatetimeIndex.tz_convertConvert tz-aware DatetimeIndex from one time zone to another.
Examples
>>> idx = pd.DatetimeIndex( ... ["1/1/2020 10:00:00+00:00", "2/1/2020 11:00:00+00:00"] ... ) >>> idx.tz datetime.timezone.utc