decode-to-db-standard-timestamp
decode-to-db-standard-date universal-time &key stream quoted => date
decode-to-db-standard-timestamp universal-time &key stream quoted => timestamp
The functions decode-db-standard-date
and decode-db-standard-timestamp
take a Lisp universal time and convert it to a SQL DATE or TIMESTAMP respectively.
The format of the date is YYYY-MM-DD.
The format of the timestamp is YYYY-MM-DD HH:MM:SS.
stream is interpreted as in cl:format
. If stream is nil
then the string representing the DATE or TIMESTAMP is returned, otherwise the string is written to the stream and nil
is returned. The default value of stream is nil
.
When quoted is true, the date or timestamp is quoted (by single quote). This is useful when these functions are used while building a SQL command string, and the result should be interpreted as a string. The default value of quoted is nil
.
LispWorks User Guide and Reference Manual - 13 Feb 2015