Returns the weekday of the given date as a number between 0 and 6, 0 being Sunday and 6 being Saturday.
Get the date elements from a date object.
Extract the date and time from a timestamp object.
ENCODE-DATE (YEAR MONTH DAY)
Create a date object.
ENCODE-INTERVAL (&KEY (YEAR 0) (MONTH 0) (WEEK 0) (DAY 0) (HOUR 0) (MINUTE 0) (SECOND 0) (MILLISECOND 0))
Create an interval object. Parameters may be negative.
ENCODE-TIMESTAMP (YEAR MONTH DAY &OPTIONAL (HOUR 0) (MINUTE 0) (SECOND 0) (MILLISECOND 0))
Create a timestamp object.
TIME<= (A B)
Compare two time-related values, returns a boolean indicating whether the first is less or equal than the second.
TIME>= (A B)
Compare two time-related values, returns a boolean indicating whether the first is greater or equal than the second.
Convert a timestamp to a Lisp universal time.
Convert a Lisp universal time to a timestamp.
DATE-ADD (BASE-DAYS MONTHS)
Add a number of months to a date (expressed in days).
Find the amount of days in a year before the start of a given month. (This works because in the internal representation march is the first month, so leap days only happen at the end of the year.)
DAYS-IN-MONTH (MONTH YEAR)
Days in a certain month -- note that these months use internal encoding.
Transform a number of days since March 1st 2000 to a date (in internal format.)
Decompose a number of milliseconds into hours, minutes, seconds and milliseconds.
ENCODE-DAYS (YEAR MONTH DAY)
Get the number of days since March 1st 2000 for a given date (in internal format.)
ENCODE-MILLISECS (HOUR MINUTE SECOND MILLISECOND)
Get the amount of milliseconds from a number of bigger units.
Invert the components of an interval.
Is this year a leap year?
Find the month in which a given day of the year falls. It's a manually constructed binary search. Which is pretty ugly.
NORMALIZE-TIMESTAMP (DAYS MILLISECS)
Make sure that a number of milliseconds falls within a day, correct the amount of days if necessary.
TO-EXTERNAL-DATE (YEAR MONTH DAY)
Convert a internal date representation to an external one. Internally, months and days start at 0 and the 1st of March 2000 is the year 0.
TO-INTERNAL-DATE (YEAR MONTH DAY)
Convert an external date representation to an internal one.
TIME-ADD (A B)
Generic function for combining datetime objects. Adding an interval to a date or timestamp will return a new date or timestamp, increased by the value of the interval. Adding two intervals returns a new interval with the sum of the two arguments. Integers can be used in place of intervals, and will be interpreted as an amount of milliseconds.
TIME-SUBTRACT (A B)
Subtracts datetime objects from each other. Subtracting two dates or timestamps results in an interval that represents the difference between them. Similarly subtracting two intervals gives their difference.
TIME< (A B)
Compare two time-related values, returns a boolean indicating whether the first is less than the second.
TIME= (A B)
Compare two time-related values, returns a boolean indicating whether they denote the same time or period.
TIME> (A B)
Compare two time-related values, returns a boolean indicating whether the first is greater than the second.
SETFDAYS (NEW-VALUE OBJECT)
SETFMILLISECS (NEW-VALUE OBJECT)
SETFMONTHS (NEW-VALUE OBJECT)
This class is used to represent dates where the time of day is not important.
Intervals can be added to date and timestamp units to get relative times. The amount of time added for the month part of a timestamp depends on the time it is being added to.
A timestamp specifies a time with a precision up to milliseconds.