Skip to main content

Module clock

Module clock 

Source
Expand description

UTC timestamps in the one format the store round-trips.

Atoms compare timestamps as strings, so the format has to sort the way the instants do: fixed width, milliseconds, Z. A shorter or longer fraction sorts wrong against what is already on disk.

Functions§

canonicalize
Rewrite any stamp parse_millis accepts into the store form.
elapsed_days
Days between two stored timestamps, floored at zero.
format_millis
Milliseconds since the epoch, formatted as YYYY-MM-DDTHH:MM:SS.mmmZ.
parse_millis
Parse a stored timestamp back to milliseconds since the epoch.
shift
A stored timestamp shifted by whole seconds, in the same format.
utcnow
Now, in the store’s format.