1.3.3 Predefined character string representation of time stamp data

Format: 'YYYY-MM-DD hh:mm:ss'

A time stamp can be made into a predefined character string representation by connecting the year (YYYY), month (MM), day (DD) with hyphens (-), space-filling any unused character positions, and then connecting the hour (hh), minute (mm), and second (ss) with colons (:), as 'YYYY-MM-DD hh:mm:ss[nn...n]'. In this process, the year (YYYY), month (MM), and date (DD) fields must be zero-filled on the left as necessary. Similarly, the hour (hh), minute (mm), and second (ss) fields must be zero-filled on the left as necessary.

When representing a fractional second precision, use a period to connect the second (ss) to the fractional second (nn...n). If fractional second precision is omitted and only a period is specified, the fractional second precision is treated as zero data. A fractional second precision greater than 7 may cause an error.

Time stamp literals that are specified using a predefined character string representation can be specified as an argument in the TIMESTAMP scalar function or where time stamp data is required.

An example of turning a time stamp into a literal in a predefined character string representation is given as follows:

Example:
Time stamp: July 30, 1995, 11:3:58
Predefined character string representation of the time stamp: '1995-07-30 11:03:58'