Next: , Previous: Timezones, Up: Public API


2.3 Creating timestamp Objects

— Function: universal-to-timestamp universal &key (nsec 0)

Produces a timestamp instance from the provided universal time universal. Universal time is defined in the Common Lisp Specification as the number of seconds since 1900-01-01T00:00:00Z.

— Function: unix-to-timestamp unix &key (nsec 0)

Produces a timestamp instance from the provided unix time unix. Unix time is defined by POSIX as the number of seconds since 1970-01-01T00:00:00Z.

— Function: now

Produces a timestamp instance with the current time. Under sbcl, the new timestamp will be precise to the microsecond. Otherwise, the precision is limited to the second.

— Function: today

Produces a timestamp instance that corresponds to today's date, which is the midnight of the current day in the UTC zone.

— Function: encode-timestamp nsec sec minute hour day month year &key timezone offset into

Returns a new timestamp instance corresponding to the specified time elements. The offset is the number of seconds offset from UTC of the locale. If offset is not specified, the offset will be guessed from the timezone. If a timestamp is passed as the into argument, its value will be set and that timestamp will be returned. Otherwise, a new timestamp is created.

— Macro: make-timestamp &key :day :sec :nsec

Expands to an expression that creates an instance of a timestamp exactly as specified.

— Macro: clone-timestamp timestamp

Expands to an expression that creates another copy of timestamp that is timestamp= to it.