Converts a Lisp universal time to standard SQL DATE and TIMESTAMP.
sql
decode-to-db-standard-date universal-time &key stream quoted => date
decode-to-db-standard-timestamp universal-time &key stream quoted => timestamp
universal-time⇩ |
A universal time. |
stream⇩ | nil , t , or an output stream. |
quoted⇩ |
A boolean. |
date |
A string or nil . |
timestamp |
A string or nil . |
The functions decode-to-db-standard-date
and decode-to-db-standard-timestamp
convert universal-time 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
.
encode-db-standard-date
encode-db-standard-timestamp
connect
23.6 Working with date fields
LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:56