The source expression is trimmed of leading and trailing pad characters and then handled as a string literal in the declaration of a TIMESTAMP string literal.
Character-to-TIMESTAMP conversion is supported for CHAR and VARCHAR types only. You cannot convert a character data type of CLOB or GRAPHIC to TIMESTAMP.
If the contents of the string can be converted to a valid TIMESTAMP value, then the conversion is performed; otherwise an error is returned.
You can use a FORMAT phrase to specify an explicit format for the TIMESTAMP target data type. A conversion that does not specify a FORMAT phrase uses the default format for the TIMESTAMP data type.
Data Type to Which Character String is Converted | Default Format |
---|---|
TIMESTAMP | Does not use time zone formatting character and does not display time zone. |
TIMESTAMP WITH TIME ZONE | Uses time zone formatting character to display time zone. |