Date, time, and timestamp are data types represented in an internal
form not seen by the SQL user.
Date, time, and timestamp can be represented by character string
values and assigned to character string variables. The database manager recognizes
the following as date, time, and timestamp values:
- A value returned by the DATE, TIME, or TIMESTAMP scalar functions.
- A value returned by the CURRENT DATE, CURRENT TIME, or CURRENT TIMESTAMP
special registers.
- A value of a character string in the ANSI/ISO standard
date, time, or timestamp format, for example, DATE '1950-01-01'.
- A character string when it is an operand of an arithmetic expression or
a comparison and the other operand is a date, time, or timestamp.
For example, in the predicate:
… WHERE HIREDATE < '1950-01-01'
if
HIREDATE is a date column, the character string '1950-01-01' is interpreted
as a date.
- A character string variable or constant used to set a date, time, or timestamp
column in either the SET clause of an UPDATE statement, or the VALUES clause
of an INSERT statement.