class _tzinfo(tzinfo): (source)
Known subclasses: dateutil.tz._common.tzrangebase
, dateutil.tz.tz.tzfile
, dateutil.tz.tz.tzlocal
, dateutil.tz.tz._tzicalvtz
Base class for all ``dateutil`` ``tzinfo`` objects.
Method | fromutc |
Given a timezone-aware datetime in a given timezone, calculates a timezone-aware datetime in a new timezone. |
Method | is |
Whether or not the "wall time" of a given datetime is ambiguous in this zone. |
Method | _fold |
Undocumented |
Method | _fold |
Determine the fold status of a "wall" datetime, given a representation of the same datetime as a (naive) UTC datetime. This is calculated based on the assumption that ``dt.utcoffset() - dt.dst()`` is constant for all datetimes, and that this offset is the actual number of hours separating ``dt_utc`` and ``dt_wall``. |
Method | _fromutc |
Given a timezone-aware datetime in a given timezone, calculates a timezone-aware datetime in a new timezone. |
dateutil.tz._common.tzrangebase
, dateutil.tz.tz.tzfile
Given a timezone-aware datetime in a given timezone, calculates a timezone-aware datetime in a new timezone. Since this is the one time that we *know* we have an unambiguous datetime object, we take this opportunity to determine whether the datetime is ambiguous and in a "fold" state (e.g. if it's the first occurrence, chronologically, of the ambiguous datetime). :param dt: A timezone-aware :class:`datetime.datetime` object.
Whether or not the "wall time" of a given datetime is ambiguous in this zone. :param dt: A :py:class:`datetime.datetime`, naive or time zone aware. :return: Returns ``True`` if ambiguous, ``False`` otherwise. .. versionadded:: 2.6.0
Determine the fold status of a "wall" datetime, given a representation of the same datetime as a (naive) UTC datetime. This is calculated based on the assumption that ``dt.utcoffset() - dt.dst()`` is constant for all datetimes, and that this offset is the actual number of hours separating ``dt_utc`` and ``dt_wall``. :param dt_utc: Representation of the datetime as UTC :param dt_wall: Representation of the datetime as "wall time". This parameter must either have a `fold` attribute or have a fold-naive :class:`datetime.tzinfo` attached, otherwise the calculation may fail.
Given a timezone-aware datetime in a given timezone, calculates a timezone-aware datetime in a new timezone. Since this is the one time that we *know* we have an unambiguous datetime object, we take this opportunity to determine whether the datetime is ambiguous and in a "fold" state (e.g. if it's the first occurrence, chronologically, of the ambiguous datetime). :param dt: A timezone-aware :class:`datetime.datetime` object.