time_origin
Stable function · Other
Tier: stable · Kind: function · Topic: Other
| Julia | TypeScript | Python | Rust | Go |
|---|---|---|---|---|
time_origin | not exported | time_origin | time_origin | not exported |
Julia
time_origin(file::EsmFile)
time_origin(file::EsmFile) -> Float64
The document’s time origin in seconds from the POSIX epoch: the instant
domain.temporal.reference_time — else domain.temporal.start, else the epoch
itself — names, as W₀ + f₀, whole seconds in integers and the fraction in
binary64. This is the origin a solver.time_span timestamp is counted from
(esm-spec §2.2.7), exposed so a caller does the same arithmetic for a timestamp
of its own with timestamp_to_seconds
.
Raises solver_time_span_invalid, naming /domain/temporal/..., when the
origin field that applies is present but is not an RFC 3339 date-time naming a
calendar day.
TypeScript
TypeScript does not export this function.
Python
time_origin(esm_file: EsmFile) -> float
The document’s time origin in binary64 seconds from the POSIX epoch.
The instant domain.temporal.reference_time – else
domain.temporal.start, else the epoch itself – names, as W0 + f0:
whole seconds in integers and the fraction in binary64. This is the origin a
solver.time_span timestamp counts from (esm-spec §2.2.7), exposed so a
caller does the same arithmetic for a timestamp of its own with
timestamp_to_seconds
.
Raises solver_time_span_invalid naming /domain/temporal/... when the
origin field that applies is present but is not an RFC 3339 date-time naming
a calendar day.
Rust
pub fn time_origin(file: &EsmFile) -> Result<f64, DiagnosticError>
The document’s time origin in seconds from the POSIX epoch (esm-spec
§2.2.7): domain.temporal.reference_time, else domain.temporal.start,
else the epoch itself, as W0 + f0 – whole seconds converted, the
fraction added in binary64.
This is the origin a solver.time_span timestamp counts from: the W0/f0
half of what resolve_time_span
does, exposed so a caller can convert a
timestamp of its own with timestamp_to_seconds
. A field that is present
but is not an RFC 3339 date-time naming a calendar day fails with
solver_time_span_invalid, naming its pointer.
Go
Go does not export this function.