tz.win

Module Contents

Classes

tzres(self,tzres_loc=”tzres.dll”) Class for accessing tzres.dll, which contains timezone name related
tzwinbase(self) tzinfo class based on win32’s timezones available in the registry.
tzwin(self,name)
tzwinlocal(self)

Functions

_settzkeyname()
picknthweekday(year,month,dayofweek,hour,minute,whichweek) dayofweek == 0 means Sunday, whichweek 5 means last instance
valuestodict(key) Convert a registry key’s values to a dictionary.
_settzkeyname()
class tzres(tzres_loc="tzres.dll")

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

New in version 2.5.0.

__init__(tzres_loc="tzres.dll")
load_name(offset)

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)

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 tzwinbase

tzinfo class based on win32’s timezones available in the registry.

__init__()
__eq__(other)
list()

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

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.
_get_hasdst()
_dst_base_offset()
class tzwin(name)
__init__(name)
__repr__()
__reduce__()
class tzwinlocal
__init__()
__repr__()
__str__()
__reduce__()
picknthweekday(year, month, dayofweek, hour, minute, whichweek)

dayofweek == 0 means Sunday, whichweek 5 means last instance

valuestodict(key)

Convert a registry key’s values to a dictionary.