Version: dev

time_origin

Stable function · Other

Tier: stable · Kind: function · Topic: Other

JuliaTypeScriptPythonRustGo
time_originnot exportedtime_origintime_originnot 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.

Source

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.

Source

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.

Source · Rust docs

Go

Go does not export this function.