DATE, TIME & TIMESTAMP Literals
TIMESTAMP
Describe a literal timestamp value. Timestamp is provided according to iso-8601 standard.
TIMESTAMP <iso-8601-timestamp>
The following example uses strftime() to extract date/time component from a timestamp value.
SELECT strftime('%m/%d/%Y %H:%M:%S', TIMESTAMP '2013-02-09T12:01:22') AS [output]
Output:
output
--------------------
02/09/2013 12:01:22
DATE
Describe a literal timestamp value. Timestamp is provided according to iso-8601 standard.
DATE <iso-8601-date>
Following example use strftime() to extract date component from a date literal value.
SELECT strftime('%m/%d/%Y', DATE '2013-02-09') AS [output]
Output look like following
output
--------------------
02/09/2013
TIME
Describe a literal timestamp value. Timestamp is provided according to iso-8601 standard.
DATE <iso-8601-time>
Following example use strftime() to extract time component from a time literal value.
SELECT strftime('%H:%M:%S', TIME '12:01:22') AS [output]
Output look like following
output
--------------------
12:01:22
Last Updated: 15 May, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.