This is the quux-time Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 07:29:07 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
Files are sorted by type and then listed depth-first from the systems components trees.
quux-time/macros.lisp
pkgdcl.lisp
(file).
quux-time
(system).
$fixnum-max-bit-index
(constant).
%defconstant-eqx-value
(function).
*unpadded-integer-strings*
(special variable).
*zero-padded-integer-strings-2*
(special variable).
*zero-padded-integer-strings-4*
(special variable).
ascii-digit-p
(function).
ascii-letter-p
(function).
check-types
(macro).
defconstant-eql
(macro).
defconstant-equal
(macro).
defconstant-equalp
(macro).
defconstant-eqx
(macro).
defconstant-unequal
(macro).
defun-inline
(macro).
ends-with
(method).
ends-with
(method).
ends-with
(method).
i*
(macro).
i+
(macro).
i-
(macro).
i/
(macro).
i/=
(macro).
i1+
(macro).
i1-
(macro).
i<
(macro).
i<=
(macro).
i=
(macro).
i>
(macro).
i>=
(macro).
iash
(macro).
iceiling
(macro).
iceiling+
(macro).
idecf
(macro).
idpb
(macro).
ifloor
(macro).
ifloor+
(macro).
iincf
(macro).
ildb
(macro).
ilogand
(macro).
ilogandc2
(macro).
ilogbit-set
(function).
ilogbit-unset
(function).
ilogbitp
(macro).
ilogcount
(macro).
ilogeqv
(macro).
ilogior
(macro).
ilognot
(macro).
ilogsubsetp
(function).
ilogtest
(macro).
ilogxor
(macro).
imax
(macro).
imaxf
(macro).
imin
(macro).
iminf
(macro).
iminusp
(macro).
imod
(macro).
integer-number-of-digits
(function).
iplusp
(macro).
irem
(macro).
itruncate
(macro).
izerop
(macro).
lower-case-ascii-letter-p
(function).
maxf
(macro).
minf
(macro).
multiple-value-let
(macro).
multiple-value-let*
(macro).
pad-string-to-width
(function).
parse-right-trimming-whitespace
(function).
string-to-integer
(function).
upper-case-ascii-letter-p
(function).
with-gensyms
(macro).
write-integer
(function).
write-integer-to-string
(function).
write-padded-fixnum
(function).
write-padded-fixnum-internal
(function).
write-unpadded-fixnum
(function).
quux-time/time.lisp
macros.lisp
(file).
quux-time
(system).
integer-date
(type).
integer-duration
(type).
integer-time
(type).
integer-tofd
(type).
print-object
(method).
$12hours
(constant).
$1hour
(constant).
$1minute
(constant).
$1second
(constant).
$1week
(constant).
$24hours
(constant).
$4hours
(constant).
$day-from-days
(special variable).
$days-per-february-year
(constant).
$days-per-month
(constant).
$days-until-month
(special variable).
$days-until-year-month
(constant).
$dofw-from-days
(special variable).
$first-minute-of-day
(constant).
$it-cache-first-day
(constant).
$it-cache-first-year
(constant).
$it-cache-last-day
(constant).
$it-cache-last-year
(constant).
$largest-tz-offset
(constant).
$last-minute-of-day
(constant).
$lowercase-days
(constant).
$lowercase-days-long
(constant).
$lowercase-days-ws
(constant).
$lowercase-months
(constant).
$lowercase-months-long
(constant).
$mixedcase-days
(constant).
$mixedcase-days-long
(constant).
$mixedcase-days-ws
(constant).
$mixedcase-months
(constant).
$mixedcase-months-long
(constant).
$month-from-days
(special variable).
$time-in-distant-future
(constant).
$time-in-distant-past
(constant).
$uppercase-days
(constant).
$uppercase-days-long
(constant).
$uppercase-days-ws
(constant).
$uppercase-months
(constant).
$uppercase-months-long
(constant).
$year-from-days
(special variable).
%days-per-february-year
(function).
%days-until-month
(function).
%days-until-year-month
(function).
%show-all-new-time-formats
(function).
%year-from-2digit-year
(function).
*current-time-function*
(special variable).
+400-years-of-seconds+
(constant).
add-days
(method).
advance-local-time
(function).
advance-to-next-day-of-week
(function).
compute-date-change
(function).
current-time-utc
(function).
current-time-utc-db-override
(function).
current-time-zoned
(function).
date-change-indicator
(function).
day-of-year
(function).
days-per-month
(function).
decode-integer-date
(function).
decode-integer-time
(function).
decode-integer-tofd
(function).
decode-universal-time
(function).
dofw-name
(function).
duration
(method).
encode-integer-date
(function).
encode-integer-time
(function).
encode-integer-tofd
(function).
encode-universal-time
(function).
explode-iso8601
(function).
explode-iso8601-date
(function).
explode-iso8601-tofd
(function).
explode-local-time
(function).
explode-local-tofd
(function).
first-minute-of-local-date
(function).
get-local-time
(function).
itus-to-ms
(function).
itus-to-us
(function).
last-minute-of-local-date
(function).
local-date-equal
(function).
local-date-long-dofw-name
(function).
local-date-offset
(function).
local-date-only
(function).
local-date-to-iso8601-string
(function).
local-date-to-string
(function).
local-date-to-string-format
(function).
local-date-to-utc
(function).
local-time
(method).
local-time-to-utc
(function).
local-tofd-only
(function).
local-tofd-to-string
(function).
make-zoned-date
(method).
make-zoned-time
(function).
merge-date-and-tofd
(function).
merge-date-and-tofd-zoned
(function).
month-name
(function).
override-local-time
(function).
parse-duration
(function).
parse-iso8601-date
(function).
parse-iso8601-local
(function).
parse-iso8601-tofd-zoned
(function).
parse-iso8601-utc
(function).
parse-iso8601-zoned
(function).
parse-local-date
(function).
parse-local-time
(function).
parse-local-tofd
(function).
roll-time
(function).
round-time-to-next-minute
(function).
server-system-time-utc
(function).
time-speeder-upper
(function).
time-speeder-upper-hires
(function).
time-to-iso8601-string
(function).
tzoffset
(reader method).
utc-date-to-local
(function).
utc-is-after-utc-p
(function).
utc-is-before-utc-p
(function).
utc-time
(reader method).
utc-time-to-local
(function).
utc-to-iso8601-string
(function).
with-current-integer-time-fixed
(macro).
with-current-time-cached
(macro).
with-current-time-fixed
(macro).
with-current-time-function
(macro).
with-virtual-sleep
(macro).
without-current-time-cached
(macro).
without-current-time-trickery
(macro).
write-duration
(function).
write-exploded-date
(function).
write-exploded-tofd
(function).
write-iso8601-local
(function).
write-iso8601-time
(function).
write-iso8601-utc
(function).
write-local-date
(function).
write-local-date-range
(function).
write-local-tofd
(function).
write-zoned-time
(function).
zoned-time
(generic function).
zoned-time
(class).
zoned-time-equal-p
(method).
Packages are listed by definition order.
quux-time
common-lisp
.
integer-date
(type).
integer-duration
(type).
integer-time
(type).
integer-tofd
(type).
$12hours
(constant).
$1hour
(constant).
$1minute
(constant).
$1second
(constant).
$1week
(constant).
$24hours
(constant).
$4hours
(constant).
$day-from-days
(special variable).
$days-per-february-year
(constant).
$days-per-month
(constant).
$days-until-month
(special variable).
$days-until-year-month
(constant).
$dofw-from-days
(special variable).
$first-minute-of-day
(constant).
$fixnum-max-bit-index
(constant).
$it-cache-first-day
(constant).
$it-cache-first-year
(constant).
$it-cache-last-day
(constant).
$it-cache-last-year
(constant).
$largest-tz-offset
(constant).
$last-minute-of-day
(constant).
$lowercase-days
(constant).
$lowercase-days-long
(constant).
$lowercase-days-ws
(constant).
$lowercase-months
(constant).
$lowercase-months-long
(constant).
$mixedcase-days
(constant).
$mixedcase-days-long
(constant).
$mixedcase-days-ws
(constant).
$mixedcase-months
(constant).
$mixedcase-months-long
(constant).
$month-from-days
(special variable).
$time-in-distant-future
(constant).
$time-in-distant-past
(constant).
$uppercase-days
(constant).
$uppercase-days-long
(constant).
$uppercase-days-ws
(constant).
$uppercase-months
(constant).
$uppercase-months-long
(constant).
$year-from-days
(special variable).
%days-per-february-year
(function).
%days-until-month
(function).
%days-until-year-month
(function).
%defconstant-eqx-value
(function).
%show-all-new-time-formats
(function).
%year-from-2digit-year
(function).
*current-time-function*
(special variable).
*unpadded-integer-strings*
(special variable).
*zero-padded-integer-strings-2*
(special variable).
*zero-padded-integer-strings-4*
(special variable).
+400-years-of-seconds+
(constant).
add-days
(generic function).
advance-local-time
(function).
advance-to-next-day-of-week
(function).
ascii-digit-p
(function).
ascii-letter-p
(function).
check-types
(macro).
compute-date-change
(function).
current-time-utc
(function).
current-time-utc-db-override
(function).
current-time-zoned
(function).
date-change-indicator
(function).
day-of-year
(function).
days-per-month
(function).
decode-integer-date
(function).
decode-integer-time
(function).
decode-integer-tofd
(function).
decode-universal-time
(function).
defconstant-eql
(macro).
defconstant-equal
(macro).
defconstant-equalp
(macro).
defconstant-eqx
(macro).
defconstant-unequal
(macro).
defun-inline
(macro).
dofw-name
(function).
duration
(generic function).
encode-integer-date
(function).
encode-integer-time
(function).
encode-integer-tofd
(function).
encode-universal-time
(function).
ends-with
(generic function).
explode-iso8601
(function).
explode-iso8601-date
(function).
explode-iso8601-tofd
(function).
explode-local-time
(function).
explode-local-tofd
(function).
first-minute-of-local-date
(function).
get-local-time
(function).
i*
(macro).
i+
(macro).
i-
(macro).
i/
(macro).
i/=
(macro).
i1+
(macro).
i1-
(macro).
i<
(macro).
i<=
(macro).
i=
(macro).
i>
(macro).
i>=
(macro).
iash
(macro).
iceiling
(macro).
iceiling+
(macro).
idecf
(macro).
idpb
(macro).
ifloor
(macro).
ifloor+
(macro).
iincf
(macro).
ildb
(macro).
ilogand
(macro).
ilogandc2
(macro).
ilogbit-set
(function).
ilogbit-unset
(function).
ilogbitp
(macro).
ilogcount
(macro).
ilogeqv
(macro).
ilogior
(macro).
ilognot
(macro).
ilogsubsetp
(function).
ilogtest
(macro).
ilogxor
(macro).
imax
(macro).
imaxf
(macro).
imin
(macro).
iminf
(macro).
iminusp
(macro).
imod
(macro).
integer-number-of-digits
(function).
iplusp
(macro).
irem
(macro).
itruncate
(macro).
itus-to-ms
(function).
itus-to-us
(function).
izerop
(macro).
last-minute-of-local-date
(function).
local-date-equal
(function).
local-date-long-dofw-name
(function).
local-date-offset
(function).
local-date-only
(function).
local-date-to-iso8601-string
(function).
local-date-to-string
(function).
local-date-to-string-format
(function).
local-date-to-utc
(function).
local-time
(generic function).
local-time-to-utc
(function).
local-tofd-only
(function).
local-tofd-to-string
(function).
lower-case-ascii-letter-p
(function).
make-zoned-date
(generic function).
make-zoned-time
(function).
maxf
(macro).
merge-date-and-tofd
(function).
merge-date-and-tofd-zoned
(function).
minf
(macro).
month-name
(function).
multiple-value-let
(macro).
multiple-value-let*
(macro).
override-local-time
(function).
pad-string-to-width
(function).
parse-duration
(function).
parse-iso8601-date
(function).
parse-iso8601-local
(function).
parse-iso8601-tofd-zoned
(function).
parse-iso8601-utc
(function).
parse-iso8601-zoned
(function).
parse-local-date
(function).
parse-local-time
(function).
parse-local-tofd
(function).
parse-right-trimming-whitespace
(function).
roll-time
(function).
round-time-to-next-minute
(function).
server-system-time-utc
(function).
string-to-integer
(function).
time-speeder-upper
(function).
time-speeder-upper-hires
(function).
time-to-iso8601-string
(function).
tzoffset
(generic reader).
upper-case-ascii-letter-p
(function).
utc-date-to-local
(function).
utc-is-after-utc-p
(function).
utc-is-before-utc-p
(function).
utc-time
(generic reader).
utc-time-to-local
(function).
utc-to-iso8601-string
(function).
with-current-integer-time-fixed
(macro).
with-current-time-cached
(macro).
with-current-time-fixed
(macro).
with-current-time-function
(macro).
with-gensyms
(macro).
with-virtual-sleep
(macro).
without-current-time-cached
(macro).
without-current-time-trickery
(macro).
write-duration
(function).
write-exploded-date
(function).
write-exploded-tofd
(function).
write-integer
(function).
write-integer-to-string
(function).
write-iso8601-local
(function).
write-iso8601-time
(function).
write-iso8601-utc
(function).
write-local-date
(function).
write-local-date-range
(function).
write-local-tofd
(function).
write-padded-fixnum
(function).
write-padded-fixnum-internal
(function).
write-unpadded-fixnum
(function).
write-zoned-time
(function).
zoned-time
(generic function).
zoned-time
(class).
zoned-time-equal-p
(generic function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
zoned-time
) stream) ¶Pretty-print a zoned-time object.
The duration of one half-day, in integer-time.
The duration of one minute, in integer-time.
The duration of one second, in integer-time.
The duration of four hours, in integer-time.
An array which maps (year) –> (days in february that year)
The map starts with the first month of year ’$it-cache-first-year’
and ends with the last month of year ’$it-cache-last-year’.
An array mapping (month) –> (days in month)
The value for February is, of course, incorrect during leap years,
hence the need for %days-per-february-year defined above.
An array which maps (year,month) –> (days preceding that year/month)
where ’days’ starts at the lisp epoch.
The map starts with the first month of year ’$it-cache-first-year’
and ends with the last month of year ’$it-cache-last-year’.
And, there are 13 months in a year – i.e. [0,12] are valid months,
and month 0 is the same as month 1.
The first minute of a day (i.e. 00:00, midnight), in integer-time.
The maximum amount that a fixnum can be shifted.
The first day (since epoch) of precomputed integer-time en-/de-coding.
The first year of precomputed integer-time en-/de-coding
The last day (since epoch) of precomputed integer-time en-/de-coding.
The last year of precomputed integer-time en-/de-coding
The largest possible timezone offset, in integer-time.
The last minute of a day (i.e. 23:59), in integer-time.
A time in the distant future.
The number of seconds in four hundred years
An array which maps (days since epoch) –> (day-of-month)
where day-of-month is in the range [1,N].
The zeroth entry in the array is for $it-cache-first-day,
the last entry is for $it-cache-last-day.
An array mapping (month) –> (days before beginning of month) The value for months after February is, of course, incorrect during leap years.
An array which maps (days since epoch) –> (day-of-week) where day-of-week is in the range [0,6] for [mon,sun]. The zeroth entry in the array is for $it-cache-first-day, the last entry is for $it-cache-last-day.
An array which maps (days since epoch) –> (month-of-year),
where month-of-year is in the range [1,12].
The zeroth entry in the array is for $it-cache-first-day,
the last entry is for $it-cache-last-day.
An array which maps (days since epoch) –> (year)
The zeroth entry in the array is for $it-cache-first-day,
the last entry is for $it-cache-last-day.
A 1000-element vector of the printed representation of each integer without any padding.
A 100-element vector of the printed representation of each integer zero-padded to two characters.
A 10000-element vector of the printed representation of each integer zero-padded to two characters.
Each clause looks like (type form1 form2 ..).
For each clause, assert that all the forms are of that type.
Example: (check-types (integer x y) (string z) ...).
A version of the * function that can only be used on fixnums.
A version of the + function that can only be used on fixnums.
A version of the - function that can only be used on fixnums.
A version of the / function that can only be used on fixnums.
A version of the /= function that can only be used on fixnums.
A version of the 1+ function that can only be used on fixnums.
A version of the 1- function that can only be used on fixnums.
A version of the < function that can only be used on fixnums.
A version of the <= function that can only be used on fixnums.
A version of the = function that can only be used on fixnums.
A version of the > function that can only be used on fixnums.
A version of the >= function that can only be used on fixnums.
A version of the ash function that can only be used on fixnums.
A version of the ceiling function that can only be used on fixnums.
A version of the ceiling+ function that can only be used on fixnums.
Set place to - of place and argument, for fixnums only.
A version of the dpb function that can only be used on fixnums.
A version of the floor function that can only be used on fixnums.
A version of the floor+ function that can only be used on fixnums.
Set place to + of place and argument, for fixnums only.
A version of the ldb function that can only be used on fixnums.
A version of the logand function that can only be used on fixnums.
A version of the logandc2 function that can only be used on fixnums.
A version of the logbitp function that can only be used on fixnums.
A version of the logcount function that can only be used on fixnums.
A version of the logeqv function that can only be used on fixnums.
A version of the logior function that can only be used on fixnums.
A version of the lognot function that can only be used on fixnums.
A version of the logtest function that can only be used on fixnums.
A version of the logxor function that can only be used on fixnums.
A version of the max function that can only be used on fixnums.
Set place to max of place and argument, for fixnums only.
A version of the min function that can only be used on fixnums.
Set place to min of place and argument, for fixnums only.
A version of the minusp function that can only be used on fixnums.
A version of the mod function that can only be used on fixnums.
A version of the plusp function that can only be used on fixnums.
A version of the rem function that can only be used on fixnums.
A version of the truncate function that can only be used on fixnums.
A version of the zerop function that can only be used on fixnums.
Set place to max of place and argument.
Set place to min of place and argument.
MULTIPLE-VALUE-LET ({(Varlist [Multiple-Value]) | (Var [Value]) | Var}*) Declaration* Form*
During evaluation of the Forms, Bind the Vars to the result of evaluating the
Value forms. If a list of variables is given, they are bound to each of the
VALUES returned by the expression, in order. The variables are bound in
parallel after all of the Values are evaluated.
MULTIPLE-VALUE-LET* ({(Varlist [Multiple-Value]) | (Var [Value]) | Var}*) Declaration* Form*
During evaluation of the Forms, Bind the Vars to the result of evaluating the
Value forms. If a list of variables is given, they are bound to each of the
VALUES returned by the expression, in order. The variables are bound in
series, so any declaration may refer to any earlier one.
Create a scope which caches/freezes the current UTC time.
This scope caches the result of (current-time-utc). Evaluations of (current-time-utc) within the scope will return the cached value. If the optional ’override-time-utc’ is provided, then the scope will cache that value instead.
Create a scope in which the current time is generated by a function.
Within this scope, evaluations of (current-time-utc) will report the
time as generated by ’new-time-function’, instead of the time as
reported by the operating system.
For example, to create a scope where time runs 5x faster than normal:
(with-current-time-function ((time-speeder-upper 5))
(process-sleep 1)
(current-time-utc)) ; This returns a time 4s in the future
These scopes may be nested. Nesting is disabled by default, since you’re
probably shooting yourself in the foot by it.
The inner-most function is first executed; if it refers to (current-time-utc), which (time-speeder-upper) does, then the function in the outer scope will provide that value. E.g. nesting two (tims-speeder-upper)s will have the effect of speeding time by the product of their rates.
BINDINGS is a list of clauses. The canonical clause looks like (VARIABLE PREFIX) where VARIABLE is a Lisp variable, and PREFIX is a string (or anything acceptable to the STRING) function. Each VARIABLE is bound to a gensym, made with the PREFIX, and the body is run inside those bindings. A clause of the form (VARIABLE) or VARIABLE is treated as (VARIABLE VARIABLE). This is available at compile-time, so macro bodies can use it.
DEPRECATED; use ’without-current-time-trickery’ instead.
Create a scope that undoes any of the current-time caches/functions.
Return the number of days in February of the given year For example: 1900 –> 28 days.
Return the number of days preceding the given month in the given year. For example: March, 2004 –> (3 2004) –> 60 days
Return the number of days since the lisp epoch which precede the given (year, month). For example: (1900 2) –> 31 days.
Convert an ambiguous 2-digit year into an unambiguous 4+-digit year.
Years before ’70 are assumed to be in the 2000’s.
’70 and later are assumed to be in the 1900’s.
This function doesn’t check that input *is* a 2-digit year.
Return the time corresponding to the next WEEKDAY calculated from TIME. WEEKDAY is an integer with 0 corresponding to Monday, 6 to Sunday. KEEP-TOFD-P, if non-NIL, indicates that the time portion of TIME should be carried over to the generated time. By default, 0:00h is returned for the time potions. Returns a timezone agnostic universal time.
If the character is an ASCII digit, return the value of the digit.
Return true if the character is an ASCII alphabetic character.
If TIME1-ZUL and TIME2-ZUL are on the same date, return nil, otherwise return the days between the two. See LOCAL-DATE-OFFSET for an explanation of the value returned.
Return the ’current’ UTC time (as an integer-time).
The ’current’ time may have been cached by ’with-current-time-cached’, or it may be skewed by ’with-current-time-function’.
Return the ’current’ UTC time (as a zoned time).
The ’current’ time may have been cached by ’with-current-time-cached’, or it may be skewed by ’with-current-time-function’.
Return a “date change” indicator that describes how many days are between TIME1-ZUL and TIME2-ZUL. If they are on the same date, " " is returned, otherwise it will be a string consisting of a #+ or a #- if TIME1-ZUL is before or after TIME2-ZUL and the number of days between the two.
Extract the 1-based day-of-year from an integer-time.
E.g. January 1 (of any year) –> 1
’time’ is an integer-time.
Result is an integer in the range [1,366].
Return the number of days in a given month in a given year.
’month’ is in the range [1,12] (where 1 == January).
’year’ is the year – which only affects the result for February.
Decode an integer-time into only its broken-down date components.
Input is an integer-time.
Result is the values <day> <month> <year> <dofw>.
This function is equivalent to (decode-universal-time ... 0),
but is precomputed and thus faster for years in the range
[$it-cache-first-year,$it-cache-last-year].
Decode an integer-time into its broken-down components.
Input is an integer-time.
Result is the values
<seconds> <minutes> <hours> <day> <month> <year> <dofw>.
This function is equivalent to (decode-universal-time ... 0),
but is precomputed and thus faster for years in the range
[$it-cache-first-year,$it-cache-last-year].
Decode an integer-time into only its broken-down time-of-day components.
Input is an integer-time.
Result is the values <seconds> <minutes> <hours>.
This function is equivalent to (decode-universal-time ... 0),
but is precomputed and thus faster for years in the range
[$it-cache-first-year,$it-cache-last-year].
Extend to decode negative numbers.
Return a string containing the English name of a numeric day-of-week.
’dofw’ belongs to the range [0,6] (0==Monday).
’size’ is one of :short (default) or :long, specifying size of name.
’case’ is one of :upper (default), :mixed or :lower.
Return value is a string, or NIL if the dofw is not in [0,6].
Encode a broken-down date specification into integer-time.
Input is the day, month, and year.
Result is an integer-time (seconds since lisp epoch).
This function is equivalent to (encode-integer-time 0 0 0 ...), but can be 3x as fast.
Encode a broken-down time specification into integer-time.
Input is the seconds, minutes, hours, day, month, and year.
Result is an integer-time (seconds since lisp epoch).
This function is equivalent to (encode-univeral-time ... 0), but is precomputed and thus faster for years in the range [$it-cache-first-year,$it-cache-last-year].
Encode a broken-down time-of-day specification into integer-time.
Input is the seconds, minutes, and hours.
Result is an integer-tofd (seconds since midnight).
This function is equivalent to (encode-integer-time ... 0 0 0), but is 7.5x as fast and does almost no consing (since a tofd always fits in a fixnum.
Extend to return negative values for years < 1900. Drop CL guessing behavior for years 0-99.
Convert an ISO-8601 date+tofd string into its numerical components.
’string’ may have one of these syntaxes:
YYYY-MM-DDThh:mm[:ss[.ffff...]]Z
YYYY-MM-DDThh:mm[:ss[.ffff...]]Saa[:bb]
YYYY-MM-DDThh:mm[:ss[.ffff...]]
where: YYYY = year
MM = month
DD = day/date
T = literal ’T’
hh = hour
mm = minute
ss = second
fff.. = fractional seconds
Z = literal ’Z’, meaning a UTC time
S = timezone offset sign: either ’-’ or ’+’
aa = timezone offset hour
bb = timezone offset minute
The return values are the components:
<seconds> [optional]
<minutes> <hours> [required]
<day> <month> <year> [required]
<tz-offset minutes> <tz-offset hours> <tz-offset sign> [optional]
<seconds fraction> [optional]
All values are integers, except for <seconds fraction> (a rational),
or missing optional values (NIL).
<tz-offset sign> is zero iff the timestring is in the UTC ’Z’ form; if any timezone is specified (even 00:00), it will be +1 or -1. <tz-offset minutes/hours> are zero if <tz-offset sign> is zero. All tz-offset values are NIL if timezone fields are not supplied.
If parsing fails, all NILs are returned.
Convert an ISO-8601 date string into its numerical components.
’string’ may have one of precisely must be YYYY-MM-DD syntax.
Return values are:
<day> <month> <year>
If parsing fails, all NILs are returned.
Convert an ISO-8601 tofd string into its numerical components.
’string’ may have one of these syntaxes:
hh:mm[:ss[.ffff...]]Z
hh:mm[:ss[.ffff...]]Saa[:bb]
hh:mm[:ss[.ffff...]]
where: hh = hour
mm = minute
ss = second
fff.. = fractional seconds
Z = literal ’Z’, meaning a UTC time
S = timezone offset sign: either ’-’ or ’+’
aa = timezone offset hour
bb = timezone offset minute
The return values are the components:
<seconds> [optional]
<minutes> <hours> [required]
<tz-offset minutes> <tz-offset hours> <tz-offset sign> [optional]
<seconds fraction> [optional]
All values are integers, except for <seconds fraction> (a rational),
or missing optional values (NIL).
<tz-offset sign> is zero iff the timestring is in the UTC ’Z’ form; if any timezone is specified (even 00:00), it will be +1 or -1. <tz-offset minutes/hours> are zero if <tz-offset sign> is zero. All tz-offset values are NIL if timezone fields are not supplied.
If parsing fails, all NILs are returned.
Explode a string into (local) date and tofd components.
Valid input formats are (maybe?):
[D]D-MTH[-YY[YY]]
[D]D-MM-YYYY
[D]D[-]M[M][-]YYYY
YYYY-MM-D[D]
YYYY[-]M[M][-]D[D]
DDMMYY
MM-YY - day is set to last day of month
MM-YYYY - day is set to last day of month
Return values are: <seconds> <minutes> <hours> <day> <month> <year>. ’year’ may be NIL if no year was supplied.
Parse a string (or substring) as a local time-of-day.
Valid formats are: HHMM HHMMSS
H..H:MM H..H:MM:SS
Returns multiple-values: <seconds> <minutes> <hours>
Return the integer-time representing the first minute on the given date.
Given a fixnum and an index, return the fixnum with the index’ed bit set to one.
Given a fixnum and an index, return the fixnum with the index’ed bit set to zero.
Given two fixnums, return true if the bits set in n1 are a subset of the bits set in n2.
Return the number of digits in the printed representation of I, which must be a non-negative integer.
Return the integer-time representing the last minute on the given date.
Return T if ’date1’ and ’date2’ have equal day, month, and year.
’date1’ and ’date2’ are integer-time’s.
Return a string with the full English name of the day-of-week.
Return the (integer) difference in _date_ between two local times.
This is essentially the difference in ’printed days’, not the
difference in ’24-hour periods’.
For example, ’2005-03-05 23:00’ and ’2005-03-06 01:00’ will yield
a 1 day difference in date, even though they are only 2 hours apart.
’time1’ and ’time2’ are local ’integer-times’.
The result is positive if time2 is later than time1.
Zero the time bits of a integer-time, leaving the date bits alone.
Return the given local integer-date DATE as a string formatted as YYYY-MM-DDD.
Return the given local integer-date DATE as string. FORMAT specifies how the
date should be formatted.
The following keywords are accepted for FORMAT:
:DATE-ONLY -> DDMTHYYY
:BRIEF -> DD-MTH-YYYY HH:MM
any of (:DDMTH :DDMTHYY :DDMTHYYYY :DD-MTH-YYYY :DDMMYY
:MMDDYY :DDMMYYYY :MMDDYYYY :YYYYMMDD :YYYYMM :YYMMDD :YYYY-MM-DD)
-> whatever WRITE-LOCAL-DATE produces for that format specification.
For all other values of FORMAT, YYYY-MM-DD HH:MM:SS is produced.
Return the given local integer-date DATE as formatted string according to the FORMAT, SHOW-WEEKDAY and USE-UPPERCASE arguments as expected by WRITE-EXPLODED-DATE.
Convert the given LOCAL-DATE/LOCAL-TOFD to UTC and return the date part. For example: 1-MAR 23:00 EST -> 2-MAR
Given a local integer-time and a TZ offset, return the UTC integer-time.
Zero the date bits of a integer-time, leaving the tofd bits alone.
Return the given time of day TOFD as string. FORMAT may be specified to control the format produced by WRITE-LOCAL-TOFD, it defaults to :HH-MM.
Return true if the character is an ASCII lowercase character.
Merge a ’date’ with a ’tofd’.
Take the date components of ’date’ (an integer-time)
and merge them with the time components of ’tofd’ (another
integer-time), generating a new integer-time.
(’date’ and ’time’ should be local to the same TZ, although the result is effectively in the same relative TZ as ’tofd’.)
Combines an integer-date and a the time portion of a zoned-time, and optionally a day offset for the local-date.
Return a string containing the English name of a numeric month.
’month’ belongs to the range [1,12] (1==January).
’size’ is one of :short (default) or :long, specifying size of name.
’case’ is one of :upper (default), :mixed or :lower.
Return value is a string, or NIL if the month is not in [1,12].
Override specific date/tofd components of an integer-time.
Returns the new integer-time constructed by replacing the specified components of the original integer-time ’time’.
Pad the string on the left until it is as long as width. If it is already longer than that, signal an exception.
Convert the duration ’string’ to a number of seconds. ’string’ may take
one of the following forms:
HH:MM HH:MM:SS HHMM HHMMSS
+HH:MM +HH:MM:SS +HHMM +HHMMSS
-HH:MM -HH:MM:SS -HHMM -HHMMSS
The sign of the result reflects the sign of the duration.
Convert an ISO-8601 date (sub)string into an integer-date.
Must be in YYYY-MM-DD syntax.
If parsing fails, NIL is returned.
Convert an ISO-8601 date+tofd (sub)string into an integer-time.
(For allowed syntaxes, see ’explode-iso8601’.)
Any fractional seconds are truncated.
Any time zone specification is ignored.
If parsing fails, NIL is returned.
Convert an ISO-8601 tofd (sub)string into a zoned-time.
(For allowed syntaxes, see ’explode-iso8601-tofd’.)
Any fractional seconds are truncated.
If parsing fails, NIL is returned.
Convert an ISO-8601 date+tofd (sub)string into a UTC integer-time.
(For allowed syntaxes, see ’explode-iso8601’.)
Any fractional seconds are truncated.
If parsing fails, NIL is returned.
Convert an ISO-8601 date+tofd (sub)string into a zoned-time.
(The allowed syntax is YYYY-MM-DDThh:mm[:ss[.ffff...]]Saa:bb;
see ’explode-iso8601’ for an explanation.)
Any fractional seconds are truncated.
If parsing fails, NIL is returned.
Parse a (sub)string as a local date, neglecting tofd components.
STRING is the time string to parse.
START and END are optional bounds.
GUESS-YEAR specifies how the year should be inferred if it is
missing from STRING. The options for GUESS-YEAR are:
a number - The given number is used when STRING does not
specify a year.
:utc-future - Choose the year such that the time is in the
future, relative to the current printed UTC
time. [default]
:utc-current - Use the year from the current printed UTC time.
NIL - Return NIL if no year is specified.
:utc-past - Choose the year such that the time is in the
past, relative to the current printed UTC time.
GUESS-YEAR-OFFSET specifies an offset (in seconds) which is added
to the current UTC time before inferring the year for a yearless
STRING. It is applicable only when GUESS-YEAR is :UTC-FUTURE or
:UTC-PAST. GUESS-YEAR-OFFSET defaults to zero.
GUESS-CENTURY specifies how the year should be interpreted if
it is specified as (exactly) two digits. The options are:
:utc-nearest - Choose a date within 50 years of the current UTC date.
:utc-past - Choose the latest century giving a past UTC date.
:utc-future - Choose the earliest century not giving a past UTC date.
:unix-y2k - Calls %year-from-2digit-year, resulting in a year
in the range 1970 to 2069 [default].
The function returns a local date represented as an integer-time, or NIL.
Parse a (sub)string as a local time (date+tofd).
STRING is the time string to parse.
START and END are optional bounds.
GUESS-YEAR specifies how the year should be inferred if it is
missing from STRING. The options for GUESS-YEAR are:
A number - The given number is used when STRING does not specify a year.
:utc-future - Choose the year such that the time is in the future (or same date), relative to
the current printed UTC date. [default]
:utc-current - Use the year from the current printed UTC date.
NIL - Return NIL if no year is specified.
:utc-past - Choose the year such that the time is in the past (or same date), relative to the
current printed UTC date.
GUESS-YEAR-OFFSET specifies an offset (in seconds) which is added
to the current UTC time before inferring the year for a yearless
STRING. It is applicable only when GUESS-YEAR is :UTC-FUTURE or
:UTC-PAST. GUESS-YEAR-OFFSET defaults to zero.
GUESS-CENTURY specifies how the year should be interpreted if
it is specified as (exactly) two digits. The options are:
:utc-nearest - Choose a date within 50 years of the current UTC date.
:utc-past - Choose the latest century giving a past UTC date.
:utc-future - Choose the earliest century not giving a past UTC date.
:unix-y2k - Calls %year-from-2digit-year, resulting in a year
in the range 1970 to 2069 [default].
The function returns a local datetime as an integer-time, or NIL.
Parse a string (or substring) as a local tofd.
Valid formats are: HHMM HHMMSS
HH:MM HH:MM:SS
Returns the number of seconds since (local) midnight.
Return an integer-time before/after TIME by SECONDS, MINUTES,
HOURS, DAYS, MONTHS or YEARS.
TIME - an integer-time (number of seconds since epoch).
SECONDS, MINUTES, HOURS, DAYS, MONTHS, YEARS - integers.
ROLL-TIME operates by adding/subtracting SECONDS, MINUTES, HOURS,
DAYS, MONTHS and YEARS (in that order) to the facsimile time
TIME. ROLL-TIME treats TIME simply as the number of seconds since
epoch ignoring DST, time zones and anything else which isn’t
passed as an argument to ‘encode-integer-time’.
Notes:
1) The length of months, expressed as a number of days,
varies. Therefore it does not always hold that:
(= x (roll-time (roll-time x :months M :years Y)
:months -M :years -Y))
2) If the result of rolling, even in an interedmiate step, ends
up before 1900-01-01T00:00:00 we lose. Example:
(roll-time (encode-universal-time 0 0 0 1 1 1900)
:days -31 :months 3)
==> ERROR
Round up an integer-time to the nearest larger minute.
Returns an integer number of minutes, which, when multiplied by $1minute, will be 0-60 greater than the input.
Return the server’s true UTC system time (as an integer-time).
This function returns the real UTC time as seen by the server’s clock,
and should only be used in situations such as logging, where the true
physical clock time is important.
Otherwise, one should always use CURRENT-TIME-UTC.
Returns a lambda that generates time at ’rate’ x normal rate.
For use in the (with-current-time-function) macro.
Note that this clock still ’ticks’ once per wallclock second; it is just that each tick moves
the time forward a large amount. If ’current-time-utc’ is called multiple times within that
second, time will appear to be frozen.
See ’time-speeder-upper-hires’ for a clock that ticks more often.
Returns a lambda that generates time at ’rate’ x normal rate, at high resolution.
For use in the (with-current-time-function) macro.
This clock ticks at the rate given by ’internal-time-units-per-second’, typically 100.
Note: this clock breaks nesting, since it only relies on the outer scope to set the initial time for the clock.
Create a string in ISO-8601 format from an integer-time.
Return true if the character is an ASCII uppercase character.
Return the local date for the given local time and UTC date. For example: 2-MAR 23:00 EST -> 1-MAR
Return T if ’a’ succeeds ’b’ in absolute (UTC) time.
Return T if ’a’ precedes ’b’ in absolute (UTC) time.
Given a UTC integer-time and a TZ offset, return the local integer-time.
Create a string in ISO-8601 format from a UTC integer-time.
Write an exploded local date to a stream; input is the component fixnums
day, month, year, weekday.
If ’weekday’ is not NIL, ’:show-weekday’ specifies where to write an
English weekday:
:before, :before-dash - before the date
:after, :dash-after - after the date
NIL - do not display weekday
If ’use-uppercase’ is NIL, mixed-case is used for English months and
weekdays.
Possible output formats are:
English Month: :ddmth ’07JAN’
:ddmthyy ’07JAN99’
:ddmthyyyy ’07JAN1999’
:dd-mth-yyyy ’07-JAN-1999’
Numeric Month: :ddmmyy ’070199’
:mmddyy ’010799’
:ddmmyyyy ’07011999’
:yyyymmdd ’19990107’
:yymmdd ’990107’
:yyyy-mm-dd ’1999-01-07’
:nu/mm/yy ’01/99’
:nu/mm/yyyy ’01/1999’
:nu/mmyy ’0199’
Return value is NIL.
Write an exploded local tofd to a stream; input is the component
seconds, minutes, and hours.
Possible output formats are:
:hh-mm = HH:MM :hh-mm-ss = HH:MM:SS :hh-mm-ap = HH:MMAM, HH:MMPM
:_h-mm = H:MM :_h-mm-ap = H:MMa, H:MMp
:hhmm = HHMM :hhmmss = HHMMSS :hhmmap = HHMMA, HHMMP
:_hmmap = HMMA, HMMP
The "_h" formats use a leading space instead of a leading zero. Return value is NIL.
Write the integer to the stream. If it’s a fixnum and width is provided, pad it to that width with the padding character.
Convenience function for int to string conversion.
Is actually a lot cheaper than prin1-to-string (1/3 the time and consing)
Write an integer-time to a stream in ISO-8601 format. decode as UTC, write as local (w/o ZULU indicator).
Write an integer-time to a stream in ISO-8601 format. decode as UTC, write with UTC/ZULU indicator.
Write the given local integer-date DATE to STREAM according to the FORMAT, SHOW-WEEKDAY and USE-UPPERCASE arguments as expected by WRITE-EXPLODED-DATE.
Write a local tofd to a stream. ’tofd’ is an integer-tofd,
i.e. seconds from midnight.
Possible output formats are:
:hh-mm = HH:MM :hh-mm-ss = HH:MM:SS :hh-mm-ap = HH:MMAM, HH:MMPM
:hhmm = HHMM :hhmmss = HHMMSS :hhmmap = HHMMA, HHMMP
Return value is NIL.
Write the fixnum to the stream, with the given width and padding.
Write the fixnum to the stream. This is more efficient than using the regular Lisp printer.
Write the zoned-time ZUL to the STREAM. If DATE-AS is specified as :ISO8601, use ISO-8601 format with possible variations as specified by DATE-AS and TIME-AS. AS-UTC, if non-NIL, indicates that the the time should be considered as being UTC, with no timezone information output. The DATE-AS and TIME-AS arguments accept format arguments as accepted by WRITE-EXPLODED-DATE and WRITE-EXPLODED-TOFD.
zoned-time
) days) ¶Add some number of days to a zoned-time.
zoned-time
) (b zoned-time
)) ¶Compute the signed duration (in seconds) from moment ’a’ to moment ’b’.
’a’ and ’b’ are ’zoned-time’ quantities.
If b is later than a, then the result is positive.
zoned-time
)) ¶Return the local time of a zoned-time object.
Returns an ’integer-time’, i.e. seconds since the beginning of the lisp epoch.
zoned-time
)) ¶Create a zoned-time matching input, but with zero’ed time components.
zoned-time
)) ¶Offset (seconds) to local timezone (from UTC)
zoned-time
)) ¶UTC integer-time representation of moment
Transform the argument into a ZONED-TIME instance.
A string is parse in ISO8601 syntax, a ZONED-TIME instance is returned, and an integer is used as
the utc argument to construct a new ZONED-TIME instance with offset 0.
zoned-time
) (b zoned-time
)) ¶Return T if zoned-times A and B are equal (same time and tzoffset)
An immutable time object which includes timezone information.
If both local and UTC views are ever relevant for some absolute temporal
quantity, then a zoned-time should be used to represent that quantity.
UTC integer-time representation of moment
quux-time:integer-time
:utc
This slot is read-only.
Jump to: | %
A C D E F G I L M O P R S T U W Z |
---|
Jump to: | %
A C D E F G I L M O P R S T U W Z |
---|
Jump to: | $
*
+
C S T |
---|
Jump to: | $
*
+
C S T |
---|
Jump to: | C F I M P Q S T Z |
---|
Jump to: | C F I M P Q S T Z |
---|