Basic module

Apollo_Time

typeSource

A point or span of time, stored as a 128-bit count of femtoseconds. A time of day counts from 20 July 1969, 20:17 UTC, not from 1970; use APOLLO_TIME_FOR_JAN_1_1970 for the Unix zero. It does not overflow in practice and keeps sub-nanosecond precision. Make one with seconds_to_apollo and its siblings or current_time_consensus, and read it back with to_seconds and the like. APOLLO_TIME_INVALID marks a failure.

Example↗
a := milliseconds_to_apollo(1500);
b := seconds_to_apollo(2);
assert(compare_apollo_times(a, b) < 0);
seconds, ok := to_seconds(b);
assert(ok && seconds == 2);
Apollo_Time :: #type,isa S128

See also