Next: , Previous: Creating timestamp Objects, Up: Public API


2.4 Querying timestamp Objects

— Function: day-of timestamp

Returns the day component of timestamp. Although Naggum's paper specifies that the day should be a signed fixnum, it is left unbounded for flexibility reasons.

— Function: sec-of timestamp

Returns the 'seconds' component of the time. Valid values for the seconds range from 0 to 86399.

— Function: nsec-of timestamp

Returns the 'microseconds' component of the time. Valid values for the nanoseconds range from 0 to 999999999.

— Function: timestamp-to-universal timestamp

This returns the date/time specified in timestamp encoded as the number of seconds since January 1st, 1900 12:00am UTC.

— Function: timestamp-to-unix timestamp

This returns the date/time specified in timestamp encoded as the number of seconds since January 1st, 1970 12:00am UTC. It corresponds with the time received from the POSIX call time().

— Function: timestamp-subtimezone timestamp timezone

Returns as multiple values the time zone applicable at the given time as the number of seconds east of UTC, a boolean daylight-saving-p, and the customary abbreviation of the timezone.

— Macro: with-decoded-timestamp (&key nsec sec minute hour day month year day-of-week daylight-p timezone) timestamp &body body

This macro binds variables to the decoded elements of timestamp. The timezone argument is used for decoding the timestamp, and is not bound by the macro. The value of day-of-week starts from 0 which means Sunday.

— Function: decode-timestamp timestamp

Returns the decoded time as (values ns ss mm hh day month year day-of-week daylight-saving-time-p timezone-offset timezone-abbreviation).

— Function: timestamp< time-a time-b
— Function: timestamp<= time-a time-b
— Function: timestamp> time-a time-b
— Function: timestamp>= time-a time-b
— Function: timestamp= time-a time-b
— Function: timestamp/= time-a time-b

These comparison functions act like their string and char counterparts.

— Function: timestamp-minimum timestamp &rest timestamps

Returns the earliest timestamp passed to it.

— Function: timestamp-maximum timestamp &rest timestamps

Returns the latest timestamp passed to it.

— Function: timestamp-day-of-week timestamp

This returns the index of the day of the week, starting at 0 which means Sunday.

Note: ”Day of the week” is ambigous and locale dependent.

— Function: universal-to-timestamp timestamp

Returns the UNIVERSAL-TIME corresponding to timestamp.

Note: Subsecond precision is not preserved.

— Function: timestamp-millennium timestamp &key timezone
— Function: timestamp-century timestamp &key timezone
— Function: timestamp-decade timestamp &key timezone

Returns the ordinal millennium, century or decade upon which the timestamp falls. Ordinal time values start at 1, so the (timestamp-century (now)) will return 21.

— Function: timestamp-year timestamp &key timezone
— Function: timestamp-month timestamp &key timezone
— Function: timestamp-day timestamp &key timezone
— Function: timestamp-hour timestamp &key timezone
— Function: timestamp-minute timestamp &key timezone
— Function: timestamp-second timestamp &key timezone
— Function: timestamp-millisecond timestamp &key timezone
— Function: timestamp-microsecond timestamp &key timezone
— Function: timestamp-microsecond timestamp &key timezone

Returns the decoded part of the timestamp.