Provides functionality for measuring and displaying time.
ConstantsConstants are variables with :const true in their metadata. Joker currently does not recognize them as special; as such, it allows redefining them or their values.
Mon Jan _2 15:04:05 2006
Number of nanoseconds in 1 hour
Number of nanoseconds in 1 microsecond
Number of nanoseconds in 1 millisecond
Number of nanoseconds in 1 minute
Number of nanoseconds in 1 nanosecond
Mon, 02 Jan 2006 15:04:05 MST
Mon, 02 Jan 2006 15:04:05 -0700
02 Jan 06 15:04 MST
02 Jan 06 15:04 -0700
Monday, 02-Jan-06 15:04:05 MST
Mon Jan 02 15:04:05 -0700 2006
Number of nanoseconds in 1 second
Jan _2 15:04:05
Jan _2 15:04:05.000000
Jan _2 15:04:05.000
Jan _2 15:04:05.000000000
Mon Jan _2 15:04:05 MST 2006
Functions, Macros, and Special Forms
(add t d)
Returns the time t+d.
(add-date t years months days)
Returns the time t + (years, months, days).
(format t layout)
Returns a textual representation of the time value formatted according to layout,
which defines the format by showing how the reference time, defined to be
Mon Jan 2 15:04:05 -0700 MST 2006
would be displayed if it were the value; it serves as an example of the desired output.
The same display rules will then be applied to the time value..
(from-unix sec nsec)
Returns the local Time corresponding to the given Unix time, sec seconds and
nsec nanoseconds since January 1, 1970 UTC. It is valid to pass nsec outside the range [0, 999999999].
Returns the duration (passed as a number of nanoseconds) as a floating point number of hours.
(in-timezone t tz)
Returns a copy of t representing the same time instant, but with the copy's timezone information set to tz for display purposes.
Returns the duration (passed as a number of nanoseconds) as a floating point number of minutes.
Returns the current local time.
(parse layout value)
Parses a time string.
Parses a duration string. A duration string is a possibly signed sequence of decimal numbers,
each with optional fraction and a unit suffix, such as 300ms, -1.5h or 2h45m. Valid time units are
ns, us (or µs), ms, s, m, h.
(round d m)
Returns the result of rounding d to the nearest multiple of m. d and m represent time durations in nanoseconds.
The rounding behavior for halfway values is to round away from zero. If m <= 0, returns d unchanged.
Returns the duration (passed as a number of nanoseconds) as a floating point number of seconds.
Returns the time in nanoseconds elapsed since t.
Pauses the execution thread for at least the duration d (expressed in nanoseconds).
A negative or zero duration causes sleep to return immediately.
Returns a string representing the duration in the form 72h3m0.5s.
(sub t u)
Returns the duration t-u in nanoseconds.
(truncate d m)
Returns the result of rounding d toward zero to a multiple of m. If m <= 0, returns d unchanged.
Returns t as a Unix time, the number of seconds elapsed since January 1, 1970 UTC.
Returns the duration in nanoseconds until t.