ut-to-string-formatter

Arguments:
string

This function is in the :anydate module, which is
autoloaded, if necessary, when this function is called. This
function was added by a patch released in May, 2014. You must have
updated Allegro CL (see sys:update-allegro) in order to use this
function.

This function converts string, containing
text and directives, into a function suitable as the value of the
format argument to universal-time-to-string when the relative
keyword argument to that function is a universal time. The function,
which converts relative times to strings, is then returned. The
function accepts five arguments: a stream
(or t or nil), an
integer or ratio indicating seconds, an integer representing minutes,
and integer representing hours, and an integer representing days.

The returned function is an interpreted function object. We recommend
you compile it (assuming the compiler is available) as in the
following example:

(setq f (compile nil (ut-to-string-formatter "%Dd%2Hh%2Mm%2Ss")))
;; Now F can be used as the value of the FORMAT argument:
(universal-time-to-string ut :relative (+ ut (* 40 3666)) :format f)
;; See the examples below for the result of this call.

The string can contain any text and also the following directives
(case is important, %d is not the same as %D):

%S - the value of the seconds argument

%M - the value of the minutes argument

%H - the value of the hours argument

%D - the value of the days argument

%p plural for the most recent value printed

%% - the % character (so % can appear in the string)

A "2" can optionally follow the % and preceed the single-letter
directive. For example, strings and possible output: