class tzrangebase(_tzinfo): (source)
Known subclasses: dateutil.tz.tz.tzrange
, dateutil.tz.win.tzwinbase
This is an abstract base class for time zones represented by an annual transition into and out of DST. Child classes should implement the following methods: * ``__init__(self, *args, **kwargs)`` * ``transitions(self, year)`` - this is expected to return a tuple of datetimes representing the DST on and off transitions in standard time. A fully initialized ``tzrangebase`` subclass should also provide the following attributes: * ``hasdst``: Boolean whether or not the zone uses DST. * ``_dst_offset`` / ``_std_offset``: :class:`datetime.timedelta` objects representing the respective UTC offsets. * ``_dst_abbr`` / ``_std_abbr``: Strings representing the timezone short abbreviations in DST and STD, respectively. * ``_hasdst``: Whether or not the zone has DST. .. versionadded:: 2.6.0
Method | __init__ |
Undocumented |
Method | __ne__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | dst |
Undocumented |
Method | fromutc |
Given a datetime in UTC, return local time |
Method | is |
Whether or not the "wall time" of a given datetime is ambiguous in this zone. |
Method | tzname |
Undocumented |
Method | utcoffset |
Undocumented |
Class Variable | __hash__ |
Undocumented |
Method | _isdst |
Undocumented |
Method | _naive |
Undocumented |
Property | _dst |
Undocumented |
Inherited from _tzinfo
:
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._tzinfo.is_ambiguous
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