Datetime expressions

This section covers date-time expression evaluation rules.

A datetime expression evaluates to a DATETIME data type.

MAIN
  DEFINE r, c DATETIME YEAR TO SECOND
  LET c = CURRENT YEAR TO SECOND
  LET r = c + INTERVAL( 234-02 ) YEAR TO MONTH
END MAIN

The operands of a datetime expression can be one of:

If a datetime expression includes an operand whose value is not a datetime data type, the runtime system attempts to convert the value to a datetime value following the data conversion rules.

If an element of an integer expression is NULL, the expression is evaluated to NULL.