types293%python.module
fault.time

Time domain classes for points in time and measures of time.

y2k = types.Timestamp.of(year=2000)
two_hours = types.Measure.of(hour=2)

# Timestamp addition.
ts = y2k.elapse(two_hours, minute=2)

# Type aware comparisons.
assert y2k.leads(ts) == True
assert y2k.follows(ts) == False

Union
import

abstract0
import

core0
import

MeasureTypes0
data

MeasureTypes = MeasureTypes

Timestamp0
data

The nanosecond precision point in time type.

Timestamp = PointTypes[0]

Date0
data

The earth-day precision point in time type.

Date = PointTypes[1]

Measure0
data

The nanosecond precision time delta type.

Measure = MeasureTypes[0]

Months0
data

The gregorian month precision time delta type. Necessary for representing months in certain cases as Measure is in exact nanoseconds.

Months = MeasureTypes[2]

PointTypes0
data

PointTypes = PointTypes

select0
data

Retrieve the most appropriate fault.time.abstract.Measure class available in Context for use with the identified unit.

assert issubclass(types.select('hour'), types.Measure)
assert issubclass(types.select('month'), types.Months)
assert issubclass(types.select('year'), types.Months)
select = Context.measure_from_unit