Time
- class Time(*args, **kwargs)[source]
Bases:
DeepDataValue
Time.
- Parameters:
time – Time.
precision – Precision.
timezone – Time zone.
calendar – Calendar model.
- datatype_class
alias of
TimeDatatype
- datatype: ClassVar[TimeDatatype] = TimeDatatype()
Datatype associated with this value class.
- template_class
alias of
TimeTemplate
- variable_class
alias of
TimeVariable
- class Precision(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]
Bases:
Enum
Time precision.
- BILLION_YEARS = 0
Billion years.
- HUNDRED_MILLION_YEARS = 1
Hundred million years.
- TEN_MILLION_YEARS = 2
Ten million years.
- MILLION_YEARS = 3
Million years.
- HUNDRED_THOUSAND_YEARS = 4
Hundred thousand years.
- TEN_THOUSAND_YEARS = 5
Ten thousand years.
- MILLENNIA = 6
Millennia.
- CENTURY = 7
Century.
- DECADE = 8
Decade.
- YEAR = 9
Year.
- MONTH = 10
Month.
- DAY = 11
Day.
- HOUR = 12
Hour.
- MINUTE = 13
Minute.
- SECOND = 14
Second.
- BILLION_YEARS = 0
Billion years.
- HUNDRED_MILLION_YEARS = 1
Hundred million years.
- TEN_MILLION_YEARS = 2
Ten million years.
- MILLION_YEARS = 3
Million years.
- HUNDRED_THOUSAND_YEARS = 4
Hundred thousand years.
- TEN_THOUSAND_YEARS = 5
Ten thousand years.
- MILLENNIA = 6
Millennia.
- CENTURY = 7
Century.
- DECADE = 8
Decade.
- YEAR = 9
Year.
- MONTH = 10
Month.
- DAY = 11
Day.
- HOUR = 12
Hour.
- MINUTE = 13
Minute.
- SECOND = 14
Second.
- classmethod check(arg: Any, function: Callable[[...], Any] | str | None = None, name: str | None = None, position: int | None = None) Self [source]
Coerces arg into an instance of this class.
If arg cannot be coerced, raises an error.
- Parameters:
arg – Value.
function – Function or function name.
name – Argument name.
position – Argument position.
- Returns:
Object.
- __init__(time: VTTimeContent, precision: VTTimePrecisionContent | None = None, timezone: VTTimeTimezoneContent | None = None, calendar: VTItem | None = None) None [source]
- property time: datetime
The date-time of time.
- get_precision(default: Time.Precision | None = None) Precision | None [source]
Gets the precision of time.
If the precision is
None
, returns default.- Parameters:
default – Default precision.
- Returns:
Precision.
- property timezone: int | None
The timezone of time.
- class TimeTemplate(*args, **kwargs)[source]
Bases:
DeepDataValueTemplate
Time template.
- Parameters:
time – Time or time variable.
precision – Precision or quantity variable.
timezone – Time zone or quantity variable.
calendar – Calendar model, item template, or item variable.
- __init__(time: VTTimeContent, precision: VTTimePrecisionContent | None = None, timezone: VTTimeTimezoneContent | None = None, calendar: VTItem | None = None) None [source]
- property time: TimeVariable | datetime
The date-time of time template.
- get_time() TimeVariable | datetime [source]
Gets the date-time of time.
- Returns:
Date-Time or time variable.
- property precision: QuantityVariable | Precision | None
The precision of time template.
- get_precision(default: QuantityVariable | Precision | None = None) QuantityVariable | Precision | None [source]
Gets the precision of time.
If the precision is
None
, returns default.- Parameters:
default – Default precision.
- Returns:
Precision or quantity variable.
- property timezone: QuantityVariable | int | None
The timezone of time template.
- get_timezone(default: QuantityVariable | int | None = None) QuantityVariable | int | None [source]
Gets the timezone of time template
If the timezone is
None
, returns default.- Parameters:
default – Default timezone.
- Returns:
Timezone or quantity variable.
- property calendar: ItemTemplate | ItemVariable | Item | None
The calendar model of time template.
- get_calendar(default: ItemTemplate | ItemVariable | Item | None = None) ItemTemplate | ItemVariable | Item | None [source]
Gets calendar model of time template.
If the calendar model is
None
, returns default.- Parameters:
default – Default calendar model.
- Returns:
Calendar model, item template, or item variable.