TIMESTAMP_ISO

Returns a timestamp value based on a date, time, or timestamp argument. If the argument is a date, it inserts zero for the time and microseconds part of the timestamp. If the argument is a time, it inserts the value of CURRENT DATE for the date part of the timestamp and zero for the microseconds part of the timestamp.

Read syntax diagramSkip visual syntax diagram
>>-TIMESTAMP_ISO--(--expression--)-----------------------------><

expression
An expression that returns a value of one of the following built-in data types: a timestamp, a date, a time, a character string, or a graphic string.

If expression is a character or graphic string, it must not be a CLOB or DBCLOB, and its value must be a valid string representation of a date or timestamp. For the valid formats of string representations of dates and timestamps, see String representations of datetime values.

The result of the function is a timestamp. If the argument can be null, the result can be null; if the argument is null, the result is the null value.

If expression is a time, the function is not deterministic.

Note

Syntax alternatives: The CAST specification should be used to increase the portability of applications. For more information, see CAST specification.

Example

  • Assume the following date value:
      SELECT TIMESTAMP_ISO( DATE( '1988-12-25' ) )
        FROM SYSIBM.SYSDUMMY1
    Returns the value '1988-12-25-00.00.00.000000'.