views1580%python.module
fault.time

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
import

functools0
import

tzif0
import

abstract0
import

Zone0
class

An ordered sequence of transition times whose ranges correspond to a particular offset.

ZoneProperties

default

The default Offset of the Zone.

ZoneOffset0
class

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
data

__slots__ = ()

ZoneOffsetunit0
data

unit = 'second'

ZoneOffsetdatum
data

datum = 0
	@property

ZoneOffsetmagnitude0
property

The offset in seconds from UTC.

ZoneOffsetabbreviation20%
property

The Offset's timezone abbreviation; such as UTC, GMT, and EST.

ZoneOffsettype0
property

Field used to identify if the Offset is daylight savings time.

ZoneOffsetis_dst0
property

Whether or not the Offset is referring to a daylight savings time offset.

ZoneOffset__hash__0
method

__hash__(self)

ZoneOffset__str__40%
method

__str__(self)

ZoneOffset__repr__10%
method

__repr__(self)

ZoneOffset__eq__0
method

__eq__(self, ob)

ZoneOffset__int__0
method

__int__(self)

ZoneOffsetiso20%
method

iso(self, pit)

Return the offset-qualified ISO representation of the given point in time.

ZoneOffsetfrom_tzinfo0
classmethod

from_tzinfo(Class, tzinfo)

Construct a Zone instance from a tzif.tzinfo tuple.

Zone__init__0
method

__init__(self, transitions, offsets, default, leaps, name)

Zone__repr__10%
method

__repr__(self)

Zonebisect0
import

Zonefind271%
method

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

self

Undocumented.

pit

The library.Timestamp to use to find an offset with.

search

Undocumented.

Zoneslice0
method

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

self

Undocumented.

start

The start of the period.

stop

The end of the period.

search

Undocumented.

Zonelocalize0
method

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

self

Undocumented.

pit

The timestamp to localize.

Zonenormalize183%
method

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

self

Undocumented.

offset

The offset of the pit.

pit

The localized point in time to normalize.

Zonefrom_tzif_data0
classmethod

from_tzif_data(Class, construct, tzd)

Zonefrom_file0
classmethod

from_file(Class, construct, filepath)

Zoneopen266%
classmethod

open(Class, construct)