Expressions.expr-primary-datetime

Use the DATE, TIME, or TIMESTAMP keywords to specify a date, time, or timestamp value.

Format

{ DATE | TIME | TIMESTAMP } { 'DateTime' | ? | ( DateTimeExpr ) }

Remarks

Follow the DATE, TIME, or TIMESTAMP keyword by the DateTime value.

The DateTime value can be one of the following:

The resulting string is interpreted as an SQL date, time, or timestamp literal. The following table describes the required format for each type:

Type Format
DATE YYYY-MM-DD
TIME HH:MM:SS[.FFFFFF]
TIMESTAMP YYYY-MM-DD HH:MM:SS[.FFFFFF]

For TIME and TIMESTAMP types, the fractional seconds part [.FFFFFF] is optional.

Example:

DATE '2025-01-31'

TIME '12:55:00.000'

TIMESTAMP ('2025-01-31' || ?)

DATE ?