pandas.DatetimeTZDtype#

class pandas.DatetimeTZDtype(unit='ns', tz=None)[source]#

An ExtensionDtype for timezone-aware datetime data.

This is not an actual numpy dtype, but a duck type.

Parameters:
unitstr, default “ns”

The precision of the datetime data. Valid options are "s", "ms", "us", "ns".

tzstr, int, or datetime.tzinfo

The timezone.

Raises:
ZoneInfoNotFoundError

When the requested timezone cannot be found.

See also

numpy.datetime64

Numpy data type for datetime.

datetime.datetime

Python datetime object.

Examples

>>> from zoneinfo import ZoneInfo
>>> pd.DatetimeTZDtype(tz=ZoneInfo("UTC"))
datetime64[ns, UTC]
>>> pd.DatetimeTZDtype(tz=ZoneInfo("Europe/Paris"))
datetime64[ns, Europe/Paris]

Attributes

unit

The precision of the datetime data.

tz

The timezone.

Methods

None