tz.win

Classes

class dateutil.tz.win.tzres(tzres_loc='tzres.dll')[source]

Class for accessing tzres.dll, which contains timezone name related resources.

New in version 2.5.0.

load_name(offset)[source]

Load a timezone name from a DLL offset (integer).

>>> from dateutil.tzwin import tzres
>>> tzr = tzres()
>>> print(tzr.load_name(112))
'Eastern Standard Time'
Parameters:offset – A positive integer value referring to a string from the tzres dll.
..note:
Offsets found in the registry are generally of the form @tzres.dll,-114. The offset in this case if 114, not -114.
name_from_string(tzname_str)[source]

Parse strings as returned from the Windows registry into the time zone name as defined in the registry.

>>> from dateutil.tzwin import tzres
>>> tzr = tzres()
>>> print(tzr.name_from_string('@tzres.dll,-251'))
'Dateline Daylight Time'
>>> print(tzr.name_from_string('Eastern Standard Time'))
'Eastern Standard Time'
Parameters:tzname_str – A timezone name string as returned from a Windows registry key.
Returns:Returns the localized timezone string from tzres.dll if the string is of the form @tzres.dll,-offset, else returns the input string.
class dateutil.tz.win.tzwin(name)[source]
display()
static list()

Return a list of all time zones known to the system.

transitions(year)

For a given year, get the DST on and off transition times, expressed always on the standard time side. For zones with no transitions, this function returns None.

Parameters:year – The year whose transitions you would like to query.
Returns:Returns a tuple of datetime.datetime objects, (dston, dstoff) for zones with an annual DST transition, or None for fixed offset zones.
class dateutil.tz.win.tzwinlocal[source]
display()
transitions(year)

For a given year, get the DST on and off transition times, expressed always on the standard time side. For zones with no transitions, this function returns None.

Parameters:year – The year whose transitions you would like to query.
Returns:Returns a tuple of datetime.datetime objects, (dston, dstoff) for zones with an annual DST transition, or None for fixed offset zones.