Skip to main content

Module clock

Module clock 

Source
Expand description

Wall-clock helpers — civil calendar without a chrono dependency.

omne-cli needs two stamp formats: YYYY-MM-DD for the volume README (omne.md frontmatter) and YYYY-MM-DDTHH:MM:SSZ for every entry in events.jsonl. Both are cheap if you have Howard Hinnant’s public-domain civil-calendar algorithm, and we already do — but Unit 11 duplicated the 15-line arithmetic into executor.rs without sharing with commands::init::chrono_today. This module is the single implementation; the two callers compose the format string they need from the returned parts.

Structs§

CivilUtc
Broken-down UTC date/time from a Unix timestamp.

Functions§

from_system_time
from_unix_seconds
Decompose a Unix second count into civil UTC parts. Public for deterministic unit tests that pin a specific instant.
now_utc
Current UTC instant as a CivilUtc. Falls back to the Unix epoch if the system clock is before 1970-01-01 (no Result — a VM with a broken clock should see 1970-01-01T00:00:00Z, which is loud enough to be noticed).