Skip to main content

Module time

Module time 

Source
Expand description

Shared time helpers: the epoch-millisecond clock and the hand-rolled Gregorian calendar conversions used for ISO 8601 wire timestamps. Kept in the kernel (the dependency floor) so every crate shares one implementation instead of a date-library dependency or a per-crate copy.

Functions§

iso8601
Format millis since the Unix epoch as YYYY-MM-DDTHH:MM:SSZ (UTC, no fractional seconds) — RFC 3339 / ISO 8601.
millis_from_iso8601
Parse an ISO 8601 UTC timestamp back to epoch milliseconds. Accepts both the fixed-width YYYY-MM-DDTHH:MM:SSZ form iso8601 emits and a fractional …:SS.fffZ form (only the leading three fraction digits are kept). Returns None unless the shape is a date T time split with in-range fields; the fraction is scanned with chars() so untrusted multibyte input never panics.
now_millis
The current wall-clock time in milliseconds since the Unix epoch, or 0 if the clock is before the epoch (unreachable on a sane system).