date — Format a local time/date


Common Lisp


(date format timestamp)

Returns a string formatted according to the given format string using the given integer timestamp or the current time if no timestamp is given. In other words, timestamp is optional and defaults to the value of

Format is according to the php format for the function with tha same name


;; Prints something like: Monday
(date "l");

;; Monday 15th of August 2005 03:12:46 PM
(date "l dS \\of F Y h:i:s A")
// July 1, 2000 is on a Sunday
(format t "July 1, 2000 is on a ~A"  
(date "l", (encode-universal-time 0, 0, 0, 7, 1, 2000)))
;; use the constants in the format parameter 
;; Mon, 15 Aug 2005 15:12:46 UTC
(date DATE-RFC822)
;; 2000-07-01T00:00:00+00:00
(date DATE-ATOM, (encode-universal-time 0, 0, 0, 7, 1, 2000))


Download is available from the main cite. SourceForge. At present only via CVS.

cvs -z3 co -P cl-date