Summary
Functions
Formats a millisecond duration as a human-readable string.
Returns the milliseconds until datetime, clamped to [0, 4_294_967_295].
Functions
@spec format(non_neg_integer() | :infinity | :hibernate) :: iodata()
Formats a millisecond duration as a human-readable string.
Also accepts :infinity or :hibernate, returning "infinity" for both.
Accepts an optional format argument:
:short(default) — compact form, e.g."1d2h3m":long— verbose form, e.g."1 day 2 hours 3 minutes"
Negative values produce a "-" prefix in short format and a "(negative) "
prefix in long format.
@spec format(non_neg_integer() | :infinity | :hibernate, :short | :long) :: iodata()
@spec until(DateTime.t() | :infinity | :hibernate) :: non_neg_integer() | :infinity | :hibernate
Returns the milliseconds until datetime, clamped to [0, 4_294_967_295].
Also accepts :infinity or :hibernate, returning the atom as-is.
An optional now argument overrides the current time (defaults to
DateTime.utc_now/0).
@spec until(DateTime.t() | :infinity | :hibernate, DateTime.t()) :: non_neg_integer() | :infinity | :hibernate