The quux-time Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The quux-time Reference Manual

This is the quux-time Reference Manual, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 12:28:51 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

This library was created by Matt Marjanovic at ITA Software as part of our QRes project.

It is published as free software under an MIT-style license (see file LICENSE).

The official home page is
	http://common-lisp.net/projects/qitab/
See also on cliki:
	http://www.cliki.net/quux-time


Note that it current initial state, it depends on some other utilities from QUUX:
	defconstant-equal
	defconstant-equalp
	defun-inline
        ...
A copy of just those functions is available in macros.lisp, but eventually should be
imported from a library.

Also, the test suite currently depends on the QRes internal test suite tools.
All of QUUX has now been published, but needs to be cleaned up before it's usable.
See the QITAB project page.
	http://common-lisp.net/projects/qitab/

We publish this code as reference only, and we invite you to rip off parts of it
in a way that better integrates with other, better libraries. In particular,
we recommend local-time as a better-designed library to be used for handling time:
	http://common-lisp.net/project/local-time/


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 quux-time

Source

quux-time.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 quux-time.asd

Location

quux-time.asd

Systems

quux-time (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 quux-time/pkgdcl.lisp

Parent

quux-time (system)

Location

pkgdcl.lisp

Packages

quux-time


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 quux-time/macros.lisp

Dependency

pkgdcl.lisp (file)

Parent

quux-time (system)

Location

macros.lisp

Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

3.1.4 quux-time/time.lisp

Dependency

macros.lisp (file)

Parent

quux-time (system)

Location

time.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 quux-time

Source

pkgdcl.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Types

Type: integer-date ()
Package

quux-time

Source

time.lisp (file)

Type: integer-duration ()
Package

quux-time

Source

time.lisp (file)

Type: integer-time ()
Package

quux-time

Source

time.lisp (file)

Type: integer-tofd ()
Package

quux-time

Source

time.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Constants

Constant: $12hours

The duration of one half-day, in integer-time.

Package

quux-time

Source

time.lisp (file)

Constant: $1hour

The duration of one hour, in integer-time.

Package

quux-time

Source

time.lisp (file)

Constant: $1minute

The duration of one minute, in integer-time.

Package

quux-time

Source

time.lisp (file)

Constant: $1second

The duration of one second, in integer-time.

Package

quux-time

Source

time.lisp (file)

Constant: $1week

The duration of one week, in integer-time.

Package

quux-time

Source

time.lisp (file)

Constant: $24hours

The duration of one day, in integer-time.

Package

quux-time

Source

time.lisp (file)

Constant: $4hours

The duration of four hours, in integer-time.

Package

quux-time

Source

time.lisp (file)

Constant: $days-per-february-year

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’.

Package

quux-time

Source

time.lisp (file)

Constant: $days-per-month

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.

Package

quux-time

Source

time.lisp (file)

Constant: $days-until-year-month

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.

Package

quux-time

Source

time.lisp (file)

Constant: $first-minute-of-day

The first minute of a day (i.e. 00:00, midnight), in integer-time.

Package

quux-time

Source

time.lisp (file)

Constant: $fixnum-max-bit-index

The maximum amount that a fixnum can be shifted.

Package

quux-time

Source

macros.lisp (file)

Constant: $it-cache-first-day

The first day (since epoch) of precomputed integer-time en-/de-coding.

Package

quux-time

Source

time.lisp (file)

Constant: $it-cache-first-year

The first year of precomputed integer-time en-/de-coding

Package

quux-time

Source

time.lisp (file)

Constant: $it-cache-last-day

The last day (since epoch) of precomputed integer-time en-/de-coding.

Package

quux-time

Source

time.lisp (file)

Constant: $it-cache-last-year

The last year of precomputed integer-time en-/de-coding

Package

quux-time

Source

time.lisp (file)

Constant: $largest-tz-offset

The largest possible timezone offset, in integer-time.

Package

quux-time

Source

time.lisp (file)

Constant: $last-minute-of-day

The last minute of a day (i.e. 23:59), in integer-time.

Package

quux-time

Source

time.lisp (file)

Constant: $lowercase-days
Package

quux-time

Source

time.lisp (file)

Constant: $lowercase-days-long
Package

quux-time

Source

time.lisp (file)

Constant: $lowercase-days-ws
Package

quux-time

Source

time.lisp (file)

Constant: $lowercase-months
Package

quux-time

Source

time.lisp (file)

Constant: $lowercase-months-long
Package

quux-time

Source

time.lisp (file)

Constant: $mixedcase-days
Package

quux-time

Source

time.lisp (file)

Constant: $mixedcase-days-long
Package

quux-time

Source

time.lisp (file)

Constant: $mixedcase-days-ws
Package

quux-time

Source

time.lisp (file)

Constant: $mixedcase-months
Package

quux-time

Source

time.lisp (file)

Constant: $mixedcase-months-long
Package

quux-time

Source

time.lisp (file)

Constant: $time-in-distant-future

A time in the distant future.

Package

quux-time

Source

time.lisp (file)

Constant: $time-in-distant-past

A time in the distant past.

Package

quux-time

Source

time.lisp (file)

Constant: $uppercase-days
Package

quux-time

Source

time.lisp (file)

Constant: $uppercase-days-long
Package

quux-time

Source

time.lisp (file)

Constant: $uppercase-days-ws
Package

quux-time

Source

time.lisp (file)

Constant: $uppercase-months
Package

quux-time

Source

time.lisp (file)

Constant: $uppercase-months-long
Package

quux-time

Source

time.lisp (file)

Constant: +400-years-of-seconds+

The number of seconds in four hundred years

Package

quux-time

Source

time.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Special variables

Special Variable: $day-from-days

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.

Package

quux-time

Source

time.lisp (file)

Special Variable: $days-until-month

An array mapping (month) –> (days before beginning of month) The value for months after February is, of course, incorrect during leap years.

Package

quux-time

Source

time.lisp (file)

Special Variable: $dofw-from-days

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.

Package

quux-time

Source

time.lisp (file)

Special Variable: $month-from-days

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.

Package

quux-time

Source

time.lisp (file)

Special Variable: $year-from-days

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.

Package

quux-time

Source

time.lisp (file)

Special Variable: *current-time-function*
Package

quux-time

Source

time.lisp (file)

Special Variable: *unpadded-integer-strings*

A 1000-element vector of the printed representation of each integer without any padding.

Package

quux-time

Source

macros.lisp (file)

Special Variable: *zero-padded-integer-strings-2*

A 100-element vector of the printed representation of each integer zero-padded to two characters.

Package

quux-time

Source

macros.lisp (file)

Special Variable: *zero-padded-integer-strings-4*

A 10000-element vector of the printed representation of each integer zero-padded to two characters.

Package

quux-time

Source

macros.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Macros

Macro: check-types &rest CLAUSES

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) ...).

Package

quux-time

Source

macros.lisp (file)

Macro: defconstant-eql SYMBOL EXPR &optional DOC
Package

quux-time

Source

macros.lisp (file)

Macro: defconstant-equal SYMBOL EXPR &optional DOC
Package

quux-time

Source

macros.lisp (file)

Macro: defconstant-equalp SYMBOL EXPR &optional DOC
Package

quux-time

Source

macros.lisp (file)

Macro: defconstant-eqx SYMBOL EXPR EQX &optional DOC
Package

quux-time

Source

macros.lisp (file)

Macro: defconstant-unequal SYMBOL EXPR &optional DOC
Package

quux-time

Source

macros.lisp (file)

Macro: defun-inline NAME ARGLIST &body BODY
Package

quux-time

Source

macros.lisp (file)

Macro: i* &rest FIXNUMS

A version of the * function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: i+ &rest FIXNUMS

A version of the + function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: i- NUMBER &rest FIXNUMS

A version of the - function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: i/ X Y

A version of the / function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: i/= &rest FIXNUMS

A version of the /= function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: i1+ X

A version of the 1+ function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: i1- X

A version of the 1- function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: i< &rest FIXNUMS

A version of the < function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: i<= &rest FIXNUMS

A version of the <= function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: i= &rest FIXNUMS

A version of the = function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: i> &rest FIXNUMS

A version of the > function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: i>= &rest FIXNUMS

A version of the >= function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: iash VALUE COUNT

A version of the ash function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: iceiling X Y

A version of the ceiling function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: iceiling+ X Y

A version of the ceiling+ function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: idecf PLACE &optional DELTA

Set place to - of place and argument, for fixnums only.

Package

quux-time

Source

macros.lisp (file)

Macro: idpb NEWVALUE BYTESPEC VALUE

A version of the dpb function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: ifloor X Y

A version of the floor function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: ifloor+ X Y

A version of the floor+ function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: iincf PLACE &optional DELTA

Set place to + of place and argument, for fixnums only.

Package

quux-time

Source

macros.lisp (file)

Macro: ildb BYTESPEC VALUE

A version of the ldb function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: ilogand &rest FIXNUMS

A version of the logand function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: ilogandc2 X Y

A version of the logandc2 function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: ilogbitp INDEX INTEGER

A version of the logbitp function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: ilogcount NUMBER

A version of the logcount function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: ilogeqv &rest FIXNUMS

A version of the logeqv function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: ilogior &rest FIXNUMS

A version of the logior function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: ilognot X

A version of the lognot function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: ilogtest X Y

A version of the logtest function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: ilogxor &rest FIXNUMS

A version of the logxor function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: imax NUMBER &rest FIXNUMS

A version of the max function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: imaxf PLACE X &rest XS

Set place to max of place and argument, for fixnums only.

Package

quux-time

Source

macros.lisp (file)

Macro: imin NUMBER &rest FIXNUMS

A version of the min function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: iminf PLACE X &rest XS

Set place to min of place and argument, for fixnums only.

Package

quux-time

Source

macros.lisp (file)

Macro: iminusp X

A version of the minusp function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: imod X Y

A version of the mod function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: iplusp X

A version of the plusp function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: irem X Y

A version of the rem function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: itruncate X Y

A version of the truncate function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: izerop X

A version of the zerop function that can only be used on fixnums.

Package

quux-time

Source

macros.lisp (file)

Macro: maxf PLACE X &rest XS

Set place to max of place and argument.

Package

quux-time

Source

macros.lisp (file)

Macro: minf PLACE X &rest XS

Set place to min of place and argument.

Package

quux-time

Source

macros.lisp (file)

Macro: multiple-value-let DECLS &body BODY

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.

Package

quux-time

Source

macros.lisp (file)

Macro: multiple-value-let* (DECL &rest DECLS) &body BODY

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.

Package

quux-time

Source

macros.lisp (file)

Macro: with-current-integer-time-fixed (INTEGER-TIME) &body BODY
Package

quux-time

Source

time.lisp (file)

Macro: with-current-time-cached (&optional OVERRIDE-TIME-UTC) &body BODY

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.

Package

quux-time

Source

time.lisp (file)

Macro: with-current-time-fixed (SECOND MINUTE HOUR DAY MONTH YEAR) &body BODY
Package

quux-time

Source

time.lisp (file)

Macro: with-current-time-function (NEW-TIME-FUNCTION &key ALLOW-NESTING?) &body BODY

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.

Package

quux-time

Source

time.lisp (file)

Macro: with-gensyms (&rest BINDINGS) &body BODY

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.

Package

quux-time

Source

macros.lisp (file)

Macro: with-virtual-sleep (&key DAYS HOURS MINS SECS) &body BODY
Package

quux-time

Source

time.lisp (file)

Macro: without-current-time-cached &body BODY

DEPRECATED; use ’without-current-time-trickery’ instead.

Package

quux-time

Source

time.lisp (file)

Macro: without-current-time-trickery &body BODY

Create a scope that undoes any of the current-time caches/functions.

Package

quux-time

Source

time.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.4 Functions

Function: %days-per-february-year YEAR

Return the number of days in February of the given year For example: 1900 –> 28 days.

Package

quux-time

Source

time.lisp (file)

Function: %days-until-month MONTH YEAR

Return the number of days preceding the given month in the given year. For example: March, 2004 –> (3 2004) –> 60 days

Package

quux-time

Source

time.lisp (file)

Function: %days-until-year-month YEAR MONTH

Return the number of days since the lisp epoch which precede the given (year, month). For example: (1900 2) –> 31 days.

Package

quux-time

Source

time.lisp (file)

Function: %defconstant-eqx-value SYMBOL EXPR EQX
Package

quux-time

Source

macros.lisp (file)

Function: %show-all-new-time-formats TIME
Package

quux-time

Source

time.lisp (file)

Function: %year-from-2digit-year 2DIGIT-YEAR

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.

Package

quux-time

Source

time.lisp (file)

Function: advance-local-time TIME &key SECONDS MINUTES HOURS DAYS
Package

quux-time

Source

time.lisp (file)

Function: advance-to-next-day-of-week TIME WEEKDAY &key KEEP-TOFD-P

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.

Package

quux-time

Source

time.lisp (file)

Function: ascii-digit-p CH

If the character is an ASCII digit, return the value of the digit.

Package

quux-time

Source

macros.lisp (file)

Function: ascii-letter-p CH

Return true if the character is an ASCII alphabetic character.

Package

quux-time

Source

macros.lisp (file)

Function: compute-date-change TIME1-ZUL TIME2-ZUL

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.

Package

quux-time

Source

time.lisp (file)

Function: current-time-utc ()

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’.

Package

quux-time

Source

time.lisp (file)

Function: current-time-utc-db-override ()
Package

quux-time

Source

time.lisp (file)

Function: current-time-zoned ()

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’.

Package

quux-time

Source

time.lisp (file)

Function: date-change-indicator TIME1-ZUL TIME2-ZUL

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.

Package

quux-time

Source

time.lisp (file)

Function: day-of-year TIME

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].

Package

quux-time

Source

time.lisp (file)

Function: days-per-month MONTH YEAR

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.

Package

quux-time

Source

time.lisp (file)

Function: decode-integer-date DATE

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].

Package

quux-time

Source

time.lisp (file)

Function: decode-integer-time TIME

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].

Package

quux-time

Source

time.lisp (file)

Function: decode-integer-tofd TOFD

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].

Package

quux-time

Source

time.lisp (file)

Function: decode-universal-time UNIVERSAL-TIME &optional TIME-ZONE

Extend to decode negative numbers.

Package

quux-time

Source

time.lisp (file)

Function: dofw-name DOFW &key SIZE CASE

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].

Package

quux-time

Source

time.lisp (file)

Function: encode-integer-date DAY MONTH YEAR

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.

Package

quux-time

Source

time.lisp (file)

Function: encode-integer-time SECONDS MINUTES HOURS DAY MONTH YEAR

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].

Package

quux-time

Source

time.lisp (file)

Function: encode-integer-tofd SECONDS MINUTES HOURS

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.

Package

quux-time

Source

time.lisp (file)

Function: encode-universal-time SECOND MINUTE HOUR DATE MONTH YEAR &optional TIME-ZONE

Extend to return negative values for years < 1900. Drop CL guessing behavior for years 0-99.

Package

quux-time

Source

time.lisp (file)

Function: explode-iso8601 STRING &key START END

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.

Package

quux-time

Source

time.lisp (file)

Function: explode-iso8601-date STRING &key START END

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.

Package

quux-time

Source

time.lisp (file)

Function: explode-iso8601-tofd STRING &key START END

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.

Package

quux-time

Source

time.lisp (file)

Function: explode-local-time STRING &key START END DEFAULT-YEAR

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.

Package

quux-time

Source

time.lisp (file)

Function: explode-local-tofd STRING &key START END

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>

Package

quux-time

Source

time.lisp (file)

Function: first-minute-of-local-date TIME

Return the integer-time representing the first minute on the given date.

Package

quux-time

Source

time.lisp (file)

Function: get-local-time TIME
Package

quux-time

Source

time.lisp (file)

Function: ilogbit-set INTEGER INDEX

Given a fixnum and an index, return the fixnum with the index’ed bit set to one.

Package

quux-time

Source

macros.lisp (file)

Function: ilogbit-unset INTEGER INDEX

Given a fixnum and an index, return the fixnum with the index’ed bit set to zero.

Package

quux-time

Source

macros.lisp (file)

Function: ilogsubsetp N1 N2

Given two fixnums, return true if the bits set in n1 are a subset of the bits set in n2.

Package

quux-time

Source

macros.lisp (file)

Function: integer-number-of-digits I

Return the number of digits in the printed representation of I, which must be a non-negative integer.

Package

quux-time

Source

macros.lisp (file)

Function: itus-to-ms ITUS
Package

quux-time

Source

time.lisp (file)

Function: itus-to-us ITUS
Package

quux-time

Source

time.lisp (file)

Function: last-minute-of-local-date TIME

Return the integer-time representing the last minute on the given date.

Package

quux-time

Source

time.lisp (file)

Function: local-date-equal DATE1 DATE2

Return T if ’date1’ and ’date2’ have equal day, month, and year.

’date1’ and ’date2’ are integer-time’s.

Package

quux-time

Source

time.lisp (file)

Function: local-date-long-dofw-name TIME &key CASE

Return a string with the full English name of the day-of-week.

Package

quux-time

Source

time.lisp (file)

Function: local-date-offset TIME1 TIME2

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.

Package

quux-time

Source

time.lisp (file)

Function: local-date-only TIME

Zero the time bits of a integer-time, leaving the date bits alone.

Package

quux-time

Source

time.lisp (file)

Function: local-date-to-iso8601-string DATE

Return the given local integer-date DATE as a string formatted as YYYY-MM-DDD.

Package

quux-time

Source

time.lisp (file)

Function: local-date-to-string DATE &optional FORMAT

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.

Package

quux-time

Source

time.lisp (file)

Function: local-date-to-string-format DATE FORMAT

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.

Package

quux-time

Source

time.lisp (file)

Function: local-date-to-utc LOCAL-DATE LOCAL-TOFD TZOFFSET

Convert the given LOCAL-DATE/LOCAL-TOFD to UTC and return the date part. For example: 1-MAR 23:00 EST -> 2-MAR

Package

quux-time

Source

time.lisp (file)

Function: local-time-to-utc TIME-LOCAL TZOFFSET

Given a local integer-time and a TZ offset, return the UTC integer-time.

Package

quux-time

Source

time.lisp (file)

Function: local-tofd-only TIME

Zero the date bits of a integer-time, leaving the tofd bits alone.

Package

quux-time

Source

time.lisp (file)

Function: local-tofd-to-string TOFD &optional FORMAT

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.

Package

quux-time

Source

time.lisp (file)

Function: lower-case-ascii-letter-p CH

Return true if the character is an ASCII lowercase character.

Package

quux-time

Source

macros.lisp (file)

Function: make-zoned-time &key UTC LOCAL TZOFFSET
Package

quux-time

Source

time.lisp (file)

Function: merge-date-and-tofd DATE TOFD

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’.)

Package

quux-time

Source

time.lisp (file)

Function: merge-date-and-tofd-zoned DATE ZUL &optional LOCAL-DATE-OFFSET

Combines an integer-date and a the time portion of a zoned-time, and optionally a day offset for the local-date.

Package

quux-time

Source

time.lisp (file)

Function: month-name MONTH &key SIZE CASE

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].

Package

quux-time

Source

time.lisp (file)

Function: override-local-time TIME &key SECONDS MINUTES HOURS DAY MONTH YEAR

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’.

Package

quux-time

Source

time.lisp (file)

Function: pad-string-to-width STR WIDTH PAD-CHAR

Pad the string on the left until it is as long as width. If it is already longer than that, signal an exception.

Package

quux-time

Source

macros.lisp (file)

Function: parse-duration STRING &key START END

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.

Package

quux-time

Source

time.lisp (file)

Function: parse-iso8601-date STRING &key START END

Convert an ISO-8601 date (sub)string into an integer-date. Must be in YYYY-MM-DD syntax.
If parsing fails, NIL is returned.

Package

quux-time

Source

time.lisp (file)

Function: parse-iso8601-local STRING &key START END

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.

Package

quux-time

Source

time.lisp (file)

Function: parse-iso8601-tofd-zoned STRING &key START END

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.

Package

quux-time

Source

time.lisp (file)

Function: parse-iso8601-utc STRING &key START END

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.

Package

quux-time

Source

time.lisp (file)

Function: parse-iso8601-zoned STRING &key START END

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.

Package

quux-time

Source

time.lisp (file)

Function: parse-local-date STRING &key START END GUESS-YEAR GUESS-YEAR-OFFSET GUESS-CENTURY

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.

Package

quux-time

Source

time.lisp (file)

Function: parse-local-time STRING &key START END GUESS-YEAR GUESS-YEAR-OFFSET GUESS-CENTURY

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.

Package

quux-time

Source

time.lisp (file)

Function: parse-local-tofd STRING &key START END

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.

Package

quux-time

Source

time.lisp (file)

Function: parse-right-trimming-whitespace PARSER TYPE STRING &rest KEYS &key END &allow-other-keys
Package

quux-time

Source

macros.lisp (file)

Function: roll-time TIME &key SECONDS MINUTES HOURS DAYS MONTHS YEARS

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

Package

quux-time

Source

time.lisp (file)

Function: round-time-to-next-minute TIME

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.

Package

quux-time

Source

time.lisp (file)

Function: server-system-time-utc ()

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.

Package

quux-time

Source

time.lisp (file)

Function: string-to-integer OBJECT &rest KEYS
Package

quux-time

Source

macros.lisp (file)

Function: time-speeder-upper RATE

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.

Package

quux-time

Source

time.lisp (file)

Function: time-speeder-upper-hires RATE

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.

Package

quux-time

Source

time.lisp (file)

Function: time-to-iso8601-string TIME UTC/LOCAL TIME-FORMAT

Create a string in ISO-8601 format from an integer-time.

Package

quux-time

Source

time.lisp (file)

Function: upper-case-ascii-letter-p CH

Return true if the character is an ASCII uppercase character.

Package

quux-time

Source

macros.lisp (file)

Function: utc-date-to-local UTC-DATE LOCAL-TOFD TZOFFSET

Return the local date for the given local time and UTC date. For example: 2-MAR 23:00 EST -> 1-MAR

Package

quux-time

Source

time.lisp (file)

Function: utc-is-after-utc-p A B

Return T if ’a’ succeeds ’b’ in absolute (UTC) time.

Package

quux-time

Source

time.lisp (file)

Function: utc-is-before-utc-p A B

Return T if ’a’ precedes ’b’ in absolute (UTC) time.

Package

quux-time

Source

time.lisp (file)

Function: utc-time-to-local TIME-UTC TZOFFSET

Given a UTC integer-time and a TZ offset, return the local integer-time.

Package

quux-time

Source

time.lisp (file)

Function: utc-to-iso8601-string TIME-UTC

Create a string in ISO-8601 format from a UTC integer-time.

Package

quux-time

Source

time.lisp (file)

Function: write-duration DURATION &optional STREAM &key FORMAT SHOW-PLUS
Package

quux-time

Source

time.lisp (file)

Function: write-exploded-date DAY MONTH YEAR WEEKDAY &optional STREAM &key FORMAT SHOW-WEEKDAY USE-UPPERCASE

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.

Package

quux-time

Source

time.lisp (file)

Function: write-exploded-tofd SECONDS MINUTES HOURS &optional STREAM &key FORMAT

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.

Package

quux-time

Source

time.lisp (file)

Function: write-integer INTEGER STREAM &key WIDTH PADDING

Write the integer to the stream. If it’s a fixnum and width is provided, pad it to that width with the padding character.

Package

quux-time

Source

macros.lisp (file)

Function: write-integer-to-string INTEGER &key WIDTH PADDING

Convenience function for int to string conversion.
Is actually a lot cheaper than prin1-to-string (1/3 the time and consing)

Package

quux-time

Source

macros.lisp (file)

Function: write-iso8601-local TIME &optional STREAM

Write an integer-time to a stream in ISO-8601 format. decode as UTC, write as local (w/o ZULU indicator).

Package

quux-time

Source

time.lisp (file)

Function: write-iso8601-time TIME UTC/LOCAL TIME-FORMAT &optional STREAM
Package

quux-time

Source

time.lisp (file)

Function: write-iso8601-utc TIME-UTC &optional STREAM

Write an integer-time to a stream in ISO-8601 format. decode as UTC, write with UTC/ZULU indicator.

Package

quux-time

Source

time.lisp (file)

Function: write-local-date DATE &optional STREAM &key FORMAT SHOW-WEEKDAY USE-UPPERCASE

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.

Package

quux-time

Source

time.lisp (file)

Function: write-local-date-range TIME1 TIME2 &optional STREAM &key CASE LONG-P SHOW-WEEKDAY SHOW-YEAR-P
Package

quux-time

Source

time.lisp (file)

Function: write-local-tofd TOFD &optional STREAM &key FORMAT

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.

Package

quux-time

Source

time.lisp (file)

Function: write-padded-fixnum FIXNUM STREAM WIDTH PAD-CHAR

Write the fixnum to the stream, with the given width and padding.

Package

quux-time

Source

macros.lisp (file)

Function: write-padded-fixnum-internal FIXNUM ABSOLUTE-VALUE WIDTH STREAM PAD-CHAR
Package

quux-time

Source

macros.lisp (file)

Function: write-unpadded-fixnum FIXNUM STREAM

Write the fixnum to the stream. This is more efficient than using the regular Lisp printer.

Package

quux-time

Source

macros.lisp (file)

Function: write-zoned-time ZUL &optional STREAM &key DATE-AS TIME-AS SHOW-WEEKDAY AS-UTC SHOW-TIMEZONE USE-UPPERCASE

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.

Package

quux-time

Source

time.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.5 Generic functions

Generic Function: add-days Z DAYS
Package

quux-time

Methods
Method: add-days (Z zoned-time) DAYS

Add some number of days to a zoned-time.

Source

time.lisp (file)

Generic Function: duration A B
Package

quux-time

Methods
Method: duration (A 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.

Source

time.lisp (file)

Generic Function: ends-with STRING SUFFIX &key END
Package

quux-time

Methods
Method: ends-with (STRING string) (SUFFIXES list) &key END
Source

macros.lisp (file)

Method: ends-with (STRING string) (SUFFIX character) &key END
Source

macros.lisp (file)

Method: ends-with (STRING string) (SUFFIX string) &key END
Source

macros.lisp (file)

Generic Function: local-time ZUL
Package

quux-time

Methods
Method: local-time (ZUL 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.

Source

time.lisp (file)

Generic Function: make-zoned-date Z
Package

quux-time

Methods
Method: make-zoned-date (Z zoned-time)

Create a zoned-time matching input, but with zero’ed time components.

Source

time.lisp (file)

Generic Function: tzoffset OBJECT
Package

quux-time

Methods
Method: tzoffset (ZONED-TIME zoned-time)

Offset (seconds) to local timezone (from UTC)

Source

time.lisp (file)

Generic Function: utc-time OBJECT
Package

quux-time

Methods
Method: utc-time (ZONED-TIME zoned-time)

UTC integer-time representation of moment

Source

time.lisp (file)

Generic Function: zoned-time TIME-DESIGNATOR

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.

Package

quux-time

Source

time.lisp (file)

Methods
Method: zoned-time (UTC-TIME integer)
Method: zoned-time (ZONED-TIME zoned-time)
Method: zoned-time (TIME-DESIGNATOR string)
Generic Function: zoned-time-equal-p A B
Package

quux-time

Methods
Method: zoned-time-equal-p (A zoned-time) (B zoned-time)

Return T if zoned-times A and B are equal (same time and tzoffset)

Source

time.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.6 Classes

Class: zoned-time ()

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.

Package

quux-time

Source

time.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: time-utc

UTC integer-time representation of moment

Type

quux-time:integer-time

Initargs

:utc

Readers

utc-time (generic function)

Slot: tz-offset

Offset (seconds) to local timezone (from UTC)

Type

quux-time:integer-time

Initargs

:tzoffset

Readers

tzoffset (generic function)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   Q  
Index Entry  Section

F
File, Lisp, quux-time.asd: The quux-time<dot>asd file
File, Lisp, quux-time/macros.lisp: The quux-time/macros<dot>lisp file
File, Lisp, quux-time/pkgdcl.lisp: The quux-time/pkgdcl<dot>lisp file
File, Lisp, quux-time/time.lisp: The quux-time/time<dot>lisp file

L
Lisp File, quux-time.asd: The quux-time<dot>asd file
Lisp File, quux-time/macros.lisp: The quux-time/macros<dot>lisp file
Lisp File, quux-time/pkgdcl.lisp: The quux-time/pkgdcl<dot>lisp file
Lisp File, quux-time/time.lisp: The quux-time/time<dot>lisp file

Q
quux-time.asd: The quux-time<dot>asd file
quux-time/macros.lisp: The quux-time/macros<dot>lisp file
quux-time/pkgdcl.lisp: The quux-time/pkgdcl<dot>lisp file
quux-time/time.lisp: The quux-time/time<dot>lisp file

Jump to:   F   L   Q  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   %  
A   C   D   E   F   G   I   L   M   O   P   R   S   T   U   W   Z  
Index Entry  Section

%
%days-per-february-year: Internal functions
%days-until-month: Internal functions
%days-until-year-month: Internal functions
%defconstant-eqx-value: Internal functions
%show-all-new-time-formats: Internal functions
%year-from-2digit-year: Internal functions

A
add-days: Internal generic functions
add-days: Internal generic functions
advance-local-time: Internal functions
advance-to-next-day-of-week: Internal functions
ascii-digit-p: Internal functions
ascii-letter-p: Internal functions

C
check-types: Internal macros
compute-date-change: Internal functions
current-time-utc: Internal functions
current-time-utc-db-override: Internal functions
current-time-zoned: Internal functions

D
date-change-indicator: Internal functions
day-of-year: Internal functions
days-per-month: Internal functions
decode-integer-date: Internal functions
decode-integer-time: Internal functions
decode-integer-tofd: Internal functions
decode-universal-time: Internal functions
defconstant-eql: Internal macros
defconstant-equal: Internal macros
defconstant-equalp: Internal macros
defconstant-eqx: Internal macros
defconstant-unequal: Internal macros
defun-inline: Internal macros
dofw-name: Internal functions
duration: Internal generic functions
duration: Internal generic functions

E
encode-integer-date: Internal functions
encode-integer-time: Internal functions
encode-integer-tofd: Internal functions
encode-universal-time: Internal functions
ends-with: Internal generic functions
ends-with: Internal generic functions
ends-with: Internal generic functions
ends-with: Internal generic functions
explode-iso8601: Internal functions
explode-iso8601-date: Internal functions
explode-iso8601-tofd: Internal functions
explode-local-time: Internal functions
explode-local-tofd: Internal functions

F
first-minute-of-local-date: Internal functions
Function, %days-per-february-year: Internal functions
Function, %days-until-month: Internal functions
Function, %days-until-year-month: Internal functions
Function, %defconstant-eqx-value: Internal functions
Function, %show-all-new-time-formats: Internal functions
Function, %year-from-2digit-year: Internal functions
Function, advance-local-time: Internal functions
Function, advance-to-next-day-of-week: Internal functions
Function, ascii-digit-p: Internal functions
Function, ascii-letter-p: Internal functions
Function, compute-date-change: Internal functions
Function, current-time-utc: Internal functions
Function, current-time-utc-db-override: Internal functions
Function, current-time-zoned: Internal functions
Function, date-change-indicator: Internal functions
Function, day-of-year: Internal functions
Function, days-per-month: Internal functions
Function, decode-integer-date: Internal functions
Function, decode-integer-time: Internal functions
Function, decode-integer-tofd: Internal functions
Function, decode-universal-time: Internal functions
Function, dofw-name: Internal functions
Function, encode-integer-date: Internal functions
Function, encode-integer-time: Internal functions
Function, encode-integer-tofd: Internal functions
Function, encode-universal-time: Internal functions
Function, explode-iso8601: Internal functions
Function, explode-iso8601-date: Internal functions
Function, explode-iso8601-tofd: Internal functions
Function, explode-local-time: Internal functions
Function, explode-local-tofd: Internal functions
Function, first-minute-of-local-date: Internal functions
Function, get-local-time: Internal functions
Function, ilogbit-set: Internal functions
Function, ilogbit-unset: Internal functions
Function, ilogsubsetp: Internal functions
Function, integer-number-of-digits: Internal functions
Function, itus-to-ms: Internal functions
Function, itus-to-us: Internal functions
Function, last-minute-of-local-date: Internal functions
Function, local-date-equal: Internal functions
Function, local-date-long-dofw-name: Internal functions
Function, local-date-offset: Internal functions
Function, local-date-only: Internal functions
Function, local-date-to-iso8601-string: Internal functions
Function, local-date-to-string: Internal functions
Function, local-date-to-string-format: Internal functions
Function, local-date-to-utc: Internal functions
Function, local-time-to-utc: Internal functions
Function, local-tofd-only: Internal functions
Function, local-tofd-to-string: Internal functions
Function, lower-case-ascii-letter-p: Internal functions
Function, make-zoned-time: Internal functions
Function, merge-date-and-tofd: Internal functions
Function, merge-date-and-tofd-zoned: Internal functions
Function, month-name: Internal functions
Function, override-local-time: Internal functions
Function, pad-string-to-width: Internal functions
Function, parse-duration: Internal functions
Function, parse-iso8601-date: Internal functions
Function, parse-iso8601-local: Internal functions
Function, parse-iso8601-tofd-zoned: Internal functions
Function, parse-iso8601-utc: Internal functions
Function, parse-iso8601-zoned: Internal functions
Function, parse-local-date: Internal functions
Function, parse-local-time: Internal functions
Function, parse-local-tofd: Internal functions
Function, parse-right-trimming-whitespace: Internal functions
Function, roll-time: Internal functions
Function, round-time-to-next-minute: Internal functions
Function, server-system-time-utc: Internal functions
Function, string-to-integer: Internal functions
Function, time-speeder-upper: Internal functions
Function, time-speeder-upper-hires: Internal functions
Function, time-to-iso8601-string: Internal functions
Function, upper-case-ascii-letter-p: Internal functions
Function, utc-date-to-local: Internal functions
Function, utc-is-after-utc-p: Internal functions
Function, utc-is-before-utc-p: Internal functions
Function, utc-time-to-local: Internal functions
Function, utc-to-iso8601-string: Internal functions
Function, write-duration: Internal functions
Function, write-exploded-date: Internal functions
Function, write-exploded-tofd: Internal functions
Function, write-integer: Internal functions
Function, write-integer-to-string: Internal functions
Function, write-iso8601-local: Internal functions
Function, write-iso8601-time: Internal functions
Function, write-iso8601-utc: Internal functions
Function, write-local-date: Internal functions
Function, write-local-date-range: Internal functions
Function, write-local-tofd: Internal functions
Function, write-padded-fixnum: Internal functions
Function, write-padded-fixnum-internal: Internal functions
Function, write-unpadded-fixnum: Internal functions
Function, write-zoned-time: Internal functions

G
Generic Function, add-days: Internal generic functions
Generic Function, duration: Internal generic functions
Generic Function, ends-with: Internal generic functions
Generic Function, local-time: Internal generic functions
Generic Function, make-zoned-date: Internal generic functions
Generic Function, tzoffset: Internal generic functions
Generic Function, utc-time: Internal generic functions
Generic Function, zoned-time: Internal generic functions
Generic Function, zoned-time-equal-p: Internal generic functions
get-local-time: Internal functions

I
i*: Internal macros
i+: Internal macros
i-: Internal macros
i/: Internal macros
i/=: Internal macros
i1+: Internal macros
i1-: Internal macros
i<: Internal macros
i<=: Internal macros
i=: Internal macros
i>: Internal macros
i>=: Internal macros
iash: Internal macros
iceiling: Internal macros
iceiling+: Internal macros
idecf: Internal macros
idpb: Internal macros
ifloor: Internal macros
ifloor+: Internal macros
iincf: Internal macros
ildb: Internal macros
ilogand: Internal macros
ilogandc2: Internal macros
ilogbit-set: Internal functions
ilogbit-unset: Internal functions
ilogbitp: Internal macros
ilogcount: Internal macros
ilogeqv: Internal macros
ilogior: Internal macros
ilognot: Internal macros
ilogsubsetp: Internal functions
ilogtest: Internal macros
ilogxor: Internal macros
imax: Internal macros
imaxf: Internal macros
imin: Internal macros
iminf: Internal macros
iminusp: Internal macros
imod: Internal macros
integer-number-of-digits: Internal functions
iplusp: Internal macros
irem: Internal macros
itruncate: Internal macros
itus-to-ms: Internal functions
itus-to-us: Internal functions
izerop: Internal macros

L
last-minute-of-local-date: Internal functions
local-date-equal: Internal functions
local-date-long-dofw-name: Internal functions
local-date-offset: Internal functions
local-date-only: Internal functions
local-date-to-iso8601-string: Internal functions
local-date-to-string: Internal functions
local-date-to-string-format: Internal functions
local-date-to-utc: Internal functions
local-time: Internal generic functions
local-time: Internal generic functions
local-time-to-utc: Internal functions
local-tofd-only: Internal functions
local-tofd-to-string: Internal functions
lower-case-ascii-letter-p: Internal functions

M
Macro, check-types: Internal macros
Macro, defconstant-eql: Internal macros
Macro, defconstant-equal: Internal macros
Macro, defconstant-equalp: Internal macros
Macro, defconstant-eqx: Internal macros
Macro, defconstant-unequal: Internal macros
Macro, defun-inline: Internal macros
Macro, i*: Internal macros
Macro, i+: Internal macros
Macro, i-: Internal macros
Macro, i/: Internal macros
Macro, i/=: Internal macros
Macro, i1+: Internal macros
Macro, i1-: Internal macros
Macro, i<: Internal macros
Macro, i<=: Internal macros
Macro, i=: Internal macros
Macro, i>: Internal macros
Macro, i>=: Internal macros
Macro, iash: Internal macros
Macro, iceiling: Internal macros
Macro, iceiling+: Internal macros
Macro, idecf: Internal macros
Macro, idpb: Internal macros
Macro, ifloor: Internal macros
Macro, ifloor+: Internal macros
Macro, iincf: Internal macros
Macro, ildb: Internal macros
Macro, ilogand: Internal macros
Macro, ilogandc2: Internal macros
Macro, ilogbitp: Internal macros
Macro, ilogcount: Internal macros
Macro, ilogeqv: Internal macros
Macro, ilogior: Internal macros
Macro, ilognot: Internal macros
Macro, ilogtest: Internal macros
Macro, ilogxor: Internal macros
Macro, imax: Internal macros
Macro, imaxf: Internal macros
Macro, imin: Internal macros
Macro, iminf: Internal macros
Macro, iminusp: Internal macros
Macro, imod: Internal macros
Macro, iplusp: Internal macros
Macro, irem: Internal macros
Macro, itruncate: Internal macros
Macro, izerop: Internal macros
Macro, maxf: Internal macros
Macro, minf: Internal macros
Macro, multiple-value-let: Internal macros
Macro, multiple-value-let*: Internal macros
Macro, with-current-integer-time-fixed: Internal macros
Macro, with-current-time-cached: Internal macros
Macro, with-current-time-fixed: Internal macros
Macro, with-current-time-function: Internal macros
Macro, with-gensyms: Internal macros
Macro, with-virtual-sleep: Internal macros
Macro, without-current-time-cached: Internal macros
Macro, without-current-time-trickery: Internal macros
make-zoned-date: Internal generic functions
make-zoned-date: Internal generic functions
make-zoned-time: Internal functions
maxf: Internal macros
merge-date-and-tofd: Internal functions
merge-date-and-tofd-zoned: Internal functions
Method, add-days: Internal generic functions
Method, duration: Internal generic functions
Method, ends-with: Internal generic functions
Method, ends-with: Internal generic functions
Method, ends-with: Internal generic functions
Method, local-time: Internal generic functions
Method, make-zoned-date: Internal generic functions
Method, tzoffset: Internal generic functions
Method, utc-time: Internal generic functions
Method, zoned-time: Internal generic functions
Method, zoned-time: Internal generic functions
Method, zoned-time: Internal generic functions
Method, zoned-time-equal-p: Internal generic functions
minf: Internal macros
month-name: Internal functions
multiple-value-let: Internal macros
multiple-value-let*: Internal macros

O
override-local-time: Internal functions

P
pad-string-to-width: Internal functions
parse-duration: Internal functions
parse-iso8601-date: Internal functions
parse-iso8601-local: Internal functions
parse-iso8601-tofd-zoned: Internal functions
parse-iso8601-utc: Internal functions
parse-iso8601-zoned: Internal functions
parse-local-date: Internal functions
parse-local-time: Internal functions
parse-local-tofd: Internal functions
parse-right-trimming-whitespace: Internal functions

R
roll-time: Internal functions
round-time-to-next-minute: Internal functions

S
server-system-time-utc: Internal functions
string-to-integer: Internal functions

T
time-speeder-upper: Internal functions
time-speeder-upper-hires: Internal functions
time-to-iso8601-string: Internal functions
tzoffset: Internal generic functions
tzoffset: Internal generic functions

U
upper-case-ascii-letter-p: Internal functions
utc-date-to-local: Internal functions
utc-is-after-utc-p: Internal functions
utc-is-before-utc-p: Internal functions
utc-time: Internal generic functions
utc-time: Internal generic functions
utc-time-to-local: Internal functions
utc-to-iso8601-string: Internal functions

W
with-current-integer-time-fixed: Internal macros
with-current-time-cached: Internal macros
with-current-time-fixed: Internal macros
with-current-time-function: Internal macros
with-gensyms: Internal macros
with-virtual-sleep: Internal macros
without-current-time-cached: Internal macros
without-current-time-trickery: Internal macros
write-duration: Internal functions
write-exploded-date: Internal functions
write-exploded-tofd: Internal functions
write-integer: Internal functions
write-integer-to-string: Internal functions
write-iso8601-local: Internal functions
write-iso8601-time: Internal functions
write-iso8601-utc: Internal functions
write-local-date: Internal functions
write-local-date-range: Internal functions
write-local-tofd: Internal functions
write-padded-fixnum: Internal functions
write-padded-fixnum-internal: Internal functions
write-unpadded-fixnum: Internal functions
write-zoned-time: Internal functions

Z
zoned-time: Internal generic functions
zoned-time: Internal generic functions
zoned-time: Internal generic functions
zoned-time: Internal generic functions
zoned-time-equal-p: Internal generic functions
zoned-time-equal-p: Internal generic functions

Jump to:   %  
A   C   D   E   F   G   I   L   M   O   P   R   S   T   U   W   Z  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   $   *   +  
C   S   T  
Index Entry  Section

$
$12hours: Internal constants
$1hour: Internal constants
$1minute: Internal constants
$1second: Internal constants
$1week: Internal constants
$24hours: Internal constants
$4hours: Internal constants
$day-from-days: Internal special variables
$days-per-february-year: Internal constants
$days-per-month: Internal constants
$days-until-month: Internal special variables
$days-until-year-month: Internal constants
$dofw-from-days: Internal special variables
$first-minute-of-day: Internal constants
$fixnum-max-bit-index: Internal constants
$it-cache-first-day: Internal constants
$it-cache-first-year: Internal constants
$it-cache-last-day: Internal constants
$it-cache-last-year: Internal constants
$largest-tz-offset: Internal constants
$last-minute-of-day: Internal constants
$lowercase-days: Internal constants
$lowercase-days-long: Internal constants
$lowercase-days-ws: Internal constants
$lowercase-months: Internal constants
$lowercase-months-long: Internal constants
$mixedcase-days: Internal constants
$mixedcase-days-long: Internal constants
$mixedcase-days-ws: Internal constants
$mixedcase-months: Internal constants
$mixedcase-months-long: Internal constants
$month-from-days: Internal special variables
$time-in-distant-future: Internal constants
$time-in-distant-past: Internal constants
$uppercase-days: Internal constants
$uppercase-days-long: Internal constants
$uppercase-days-ws: Internal constants
$uppercase-months: Internal constants
$uppercase-months-long: Internal constants
$year-from-days: Internal special variables

*
*current-time-function*: Internal special variables
*unpadded-integer-strings*: Internal special variables
*zero-padded-integer-strings-2*: Internal special variables
*zero-padded-integer-strings-4*: Internal special variables

+
+400-years-of-seconds+: Internal constants

C
Constant, $12hours: Internal constants
Constant, $1hour: Internal constants
Constant, $1minute: Internal constants
Constant, $1second: Internal constants
Constant, $1week: Internal constants
Constant, $24hours: Internal constants
Constant, $4hours: Internal constants
Constant, $days-per-february-year: Internal constants
Constant, $days-per-month: Internal constants
Constant, $days-until-year-month: Internal constants
Constant, $first-minute-of-day: Internal constants
Constant, $fixnum-max-bit-index: Internal constants
Constant, $it-cache-first-day: Internal constants
Constant, $it-cache-first-year: Internal constants
Constant, $it-cache-last-day: Internal constants
Constant, $it-cache-last-year: Internal constants
Constant, $largest-tz-offset: Internal constants
Constant, $last-minute-of-day: Internal constants
Constant, $lowercase-days: Internal constants
Constant, $lowercase-days-long: Internal constants
Constant, $lowercase-days-ws: Internal constants
Constant, $lowercase-months: Internal constants
Constant, $lowercase-months-long: Internal constants
Constant, $mixedcase-days: Internal constants
Constant, $mixedcase-days-long: Internal constants
Constant, $mixedcase-days-ws: Internal constants
Constant, $mixedcase-months: Internal constants
Constant, $mixedcase-months-long: Internal constants
Constant, $time-in-distant-future: Internal constants
Constant, $time-in-distant-past: Internal constants
Constant, $uppercase-days: Internal constants
Constant, $uppercase-days-long: Internal constants
Constant, $uppercase-days-ws: Internal constants
Constant, $uppercase-months: Internal constants
Constant, $uppercase-months-long: Internal constants
Constant, +400-years-of-seconds+: Internal constants

S
Slot, time-utc: Internal classes
Slot, tz-offset: Internal classes
Special Variable, $day-from-days: Internal special variables
Special Variable, $days-until-month: Internal special variables
Special Variable, $dofw-from-days: Internal special variables
Special Variable, $month-from-days: Internal special variables
Special Variable, $year-from-days: Internal special variables
Special Variable, *current-time-function*: Internal special variables
Special Variable, *unpadded-integer-strings*: Internal special variables
Special Variable, *zero-padded-integer-strings-2*: Internal special variables
Special Variable, *zero-padded-integer-strings-4*: Internal special variables

T
time-utc: Internal classes
tz-offset: Internal classes

Jump to:   $   *   +  
C   S   T  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   I   P   Q   S   T   Z  
Index Entry  Section

C
Class, zoned-time: Internal classes

I
integer-date: Exported types
integer-duration: Exported types
integer-time: Exported types
integer-tofd: Exported types

P
Package, quux-time: The quux-time package

Q
quux-time: The quux-time system
quux-time: The quux-time package

S
System, quux-time: The quux-time system

T
Type, integer-date: Exported types
Type, integer-duration: Exported types
Type, integer-time: Exported types
Type, integer-tofd: Exported types

Z
zoned-time: Internal classes

Jump to:   C   I   P   Q   S   T   Z