Access to timezone views for adjusting timestamps in and out of local forms.
Usage:
from fault.time import types, views
z = views.Zone.open(types.from_unix_timestamp, "America/Los_Angeles")
os0
functools0
tzif0
abstract0
Zone0
An ordered sequence of transition times whose ranges correspond to a particular offset.
ZoneProperties
ZoneOffset0
Offsets are constructed by a tuple of the form: (offset, abbreviation, type). Primarily, the type signifies whether or not the offset is daylight savings or not.
Offset instances are usually extracted from Zone objects which build a sequence of transitions for subsequent searching.
ZoneOffset__slots__0
__slots__ = ()
ZoneOffsetunit0
unit = 'second'
ZoneOffsetdatum
datum = 0
@property
ZoneOffsetmagnitude0
The offset in seconds from UTC.
ZoneOffsetabbreviation20%
The Offset's timezone abbreviation; such as UTC, GMT, and EST.
ZoneOffsettype0
Field used to identify if the Offset is daylight savings time.
ZoneOffsetis_dst0
Whether or not the Offset is referring to a daylight savings time offset.
ZoneOffset__hash__0
__hash__(self)
ZoneOffset__str__40%
__str__(self)
ZoneOffset__repr__10%
__repr__(self)
ZoneOffset__eq__0
__eq__(self, ob)
ZoneOffset__int__0
__int__(self)
ZoneOffsetiso20%
iso(self, pit)
Return the offset-qualified ISO representation of the given point in time.
ZoneOffsetfrom_tzinfo0
from_tzinfo(Class, tzinfo)
Construct a Zone instance from a tzif.tzinfo tuple.
Zone__init__0
__init__(self, transitions, offsets, default, leaps, name)
Zone__repr__10%
__repr__(self)
Zonebisect0
Zonefind271%
find(self, pit)
Get the appropriate offset in the zone for a given Point In Time, pit. If the pit does not fall within a known range, the default will be returned.
Returns an offset for the timestamp according to the Zone's transition times.
ZonefindParameters
pitThe library.Timestamp to use to find an offset with.
Zoneslice0
slice(self, start, stop)
Get a slice of transition points and time zone offsets relative to a given start and stop.
Returns an iterable of transitions and Offset instances that have occurred during the period designated by the slice.
ZonesliceParameters
Zonelocalize0
localize(self, pit)
Given pit, return the localized version according to the zone's transitions.
The given Point In Time is expected to have a perspective consistent with the zone's transition times. (In the same zone.)
Returns the localized timestamp.
ZonelocalizeParameters
Zonenormalize183%
normalize(self, offset, pit)
This function should be used in cases where adjustments are being made to an already zoned point in time. Once the adjustments are complete, the point should be normalized in order to properly represent the local point.
If no change is necessary, the exact, given pit will be returned.
Returns the re-localized pit and its new Offset in a tuple.
ZonenormalizeParameters
offsetThe offset of the pit.
Zonefrom_tzif_data0
from_tzif_data(Class, construct, tzd)
Zonefrom_file0
from_file(Class, construct, filepath)
Zoneopen266%
open(Class, construct)