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 fractional seconds 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 fractional seconds part of the timestamp.

Read syntax diagramSkip visual syntax diagramTIMESTAMP_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, 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.

If expression is a timestamp, the result of the function is a timestamp with the same precision as expression. Otherwise, the result of the function is TIMESTAMP(6). 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'.