A date, time, or timestamp value can be compared either with another value of the same data type or with a string representation of that data type.
All comparisons are chronological, which means the farther a time is from January 1, 0001, the greater the value of that time.
Comparisons involving time values and string representations of time values always include seconds. If the string representation omits seconds, zero seconds are implied.
TIMESTAMP ('1990-02-23-00.00.00') > '1990-02-22-24.00.00'
When a character, DBCS-open, or DBCS-either field or constant is represented as a date, time, or timestamp, the following rules apply:
Date: The length of the field or literal must be at least 8 if the date format is *ISO, *USA, *EUR, *JIS, *YMD, *MDY, or *DMY. If the date format is *JUL (yyddd), the length of the variable must be at least 6 (includes the separator between yy and ddd). The field or literal can be padded with blanks.
Time: For all of the time formats (*USA, *ISO, *EUR, *JIS, *HMS), the length of the field or literal must be at least 4. The field or literal can be padded with blanks.
Timestamp: For the timestamp format (yyyy-mm-dd-hh.mm.ss.uuuuuu), the length of the field or literal must be at least 16. The field or literal can be padded with blanks.