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
abstract0
core0
MeasureTypes0
MeasureTypes = MeasureTypes
Timestamp0
The nanosecond precision point in time type.
Timestamp = PointTypes[0]
Date0
The earth-day precision point in time type.
Date = PointTypes[1]
Measure0
The nanosecond precision time delta type.
Measure = MeasureTypes[0]
Months0
The gregorian month precision time delta type. Necessary for representing months in certain cases as Measure is in exact nanoseconds.
Months = MeasureTypes[2]
PointTypes0
PointTypes = PointTypes
select0
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