win32timezone.TimeZoneInfo Object
Main class for handling Windows time zones.
Usage:
TimeZoneInfo(<Time Zone Standard Name>, [<Fix Standard Time>])
Comments
If <Fix Standard Time> evaluates to True, daylight savings time is
calculated in the same way as standard time.
>>> tzi = TimeZoneInfo('Pacific Standard Time')
>>> march31 = datetime.datetime(2000,3,31)
We know that time zone definitions haven't changed from 2007
to 2012, so regardless of whether dynamic info is available,
there should be consistent results for these years.
>>> subsequent_years = [march31.replace(year=year)
... for year in range(2007, 2013)]
>>> offsets = set(tzi.utcoffset(year) for year in subsequent_years)
>>> len(offsets)
1
Methods
- GetDSTStartTime
- Given a year, determines the time when daylight savings time starts
- get_sorted_time_zones
- Return the time zones sorted by some key.
- utc
- Returns a time-zone representing UTC.
- GetDSTEndTime
- Given a year, determines the time when daylight savings ends.
- dst
- Calculate the daylight savings offset according to the
- get_sorted_time_zone_names
- Return a list of time zone names that can
- utcoffset
- Calculates the utcoffset according to the datetime.tzinfo spec
- getWinInfo
- Return the most relevant "info" for this time zone
- local
- Returns the local time zone as defined by the operating system in the