Expand description
Tiny time helpers shared by the harness adapter
(super::super::harnesses::claude).
Both call sites need the same two operations:
iso_now— current wall-clock inYYYY-MM-DDTHH:MM:SS.mmmZformat, matchingnew Date().toISOString()in the TS sibling.civil_from_days— Howard Hinnant’s days-since-epoch → (Y, M, D) conversion. Pulled out so we don’t pay achrono/timedependency for two tiny call sites.
Until D5 / D6 these were duplicated across harnesses/claude.rs and
commands/run.rs with a keep them in sync comment. CodeRabbit caught
the duplication during PR #318 review; this module is the resolution.
Functions§
- civil_
from_ days - Days-since-epoch → (year, month, day). Hinnant 2014.
- iso_
from_ system_ time - Format an absolute
total_ms(millis since the Unix epoch) as an ISO-8601 UTC string. Split out so callers that already captured aSystemTime(e.g. the driver’sspawn_start_ts) can format it without re-reading the clock. - iso_now
- Build an ISO-8601 UTC timestamp suitable for
Stamp::ts/ theburnSpawnTsenrichment tag. Mirrorsnew Date().toISOString()in the TS sibling.