The TIMESTAMP_FORMAT function returns a timestamp.
The resulting substring is interpreted as a timestamp using the format specified by format-string.
year current year month current month day 01 hour 00 minute 00 second 00 microsecond 00
A substring of the string-expression representing a component of a timestamp (such as year, month, day, hour, minutes, seconds) can include less than the maximum number of digits for that component of the timestamp. Any missing digits default to zero. For example, with a format-string of 'YYYY-MM-DD HH24:MI:SS', an input value of '999-3-9 5:7:2' would produce the same result as '0999-03-09 05:07:02'.
Examples of valid format strings are:
'YYYY-MM-DD' 'YYYY-MM-DD-HH24-MI-SS' 'YYYY-MM-DD-HH24-MI-SS-NNNNNN'
The result is timestamp. If the first argument can be null, the result can be null; if the first argument is null, the result is the null value.
Determinism: TIMESTAMP_FORMAT is a non-deterministic function.
Syntax alternatives: TO_DATE is a synonym for TIMESTAMP_FORMAT.
SELECT VARCHAR_FORMAT(ROUTINE_CREATED, 'YYYY-MM-DD HH24:MI:SS')
INTO :TVAR
FROM QSYS2.SYSPROCS
WHERE ROUTINE_CREATED =
TIMESTAMP_FORMAT('1999-12-31 23:59:59, 'YYYY-MM-DD HH24:MI:SS')