All Manuals > LispWorks User Guide and Reference Manual > 47 The SQL Package

NextPrevUpTopContentsIndex

encode-db-standard-date

encode-db-standard-timestamp

Functions
Summary

Convert standard SQL DATE and TIMESTAMP to Lisp universal time.

Package

sql

Signature

encode-db-standard-date date-string => result

encode-db-standard-timestamp timestamp-string => result

Arguments

date-string

A string.

timestamp-string

A string.

Values

result

A Lisp universal time or nil.

Description

The functions encode-db-standard-date and encode-db-standard-timestamp interpret their argument as a DATE or TIMESTAMP and return the corresponding universal time.

date-string must be a string of length at least 10, where the first 10 characters specify a DATE, that is have the format YYYY-MM-DD.

timestamp-string must be a string of length at least 19, where the first 19 characters specify a TIMESTAMP, that is have the format YYYY-MM-DD HH:MM:SS.

encode-db-standard-date and encode-db-standard-timestamp do not actually check the separators between the numeric values, so the hyphens, space and colons can each be replaced by any character. Both functions return nil if the argument is not correct.

See also

decode-to-db-standard-date
decode-to-db-standard-timestamp
connect
Working with date fields


LispWorks User Guide and Reference Manual - 20 Sep 2017

NextPrevUpTopContentsIndex