now! : () => Timestamp
Read the current POSIX wall-clock timestamp.
:= []
Read and manipulate POSIX wall-clock timestamps.
A timestamp is an instant represented relative to the Unix epoch. It does not contain a calendar, time zone, formatting policy, or leap-second model. Use a Roc package such as roc-gregorian for those pure computations.
now! : () => Timestamp
Read the current POSIX wall-clock timestamp.
UnixTime.Timestamp :: # (opaque)
A normalized POSIX timestamp.
nanosecond is always less than 1,000,000,000. Negative instants use
floor-based seconds, so one nanosecond before the epoch is represented as
{ seconds: -1, nanosecond: 999_999_999 }.
is_eq : _
from_parts : { seconds : I64, nanosecond : U32 } -> Try(Timestamp, [InvalidNanosecond])
Construct a normalized timestamp.
from_nanos_since_epoch : I128 -> Try(Timestamp, [OutOfRange])
Construct a timestamp from signed nanoseconds since the Unix epoch.
seconds_since_epoch : Timestamp -> I64
Return whole seconds since the Unix epoch, rounded toward negative infinity.
subsecond_nanoseconds : Timestamp -> U32
Return the normalized fractional nanoseconds within the timestamp's current second.
nanos_since_epoch : Timestamp -> I128
Return signed nanoseconds since the Unix epoch.
difference_nanos : Timestamp, Timestamp -> I128
Return later - earlier in nanoseconds.