TIME
The TIME function returns a time that is derived from a value.
The schema is SYSIBM.
The argument must be an expression that returns a value of one of the following built-in data types: a time, a timestamp, a character string, or a graphic string. If expression is a character or graphic string, it must not be a CLOB or DBCLOB, and its value must be a valid string representation of a time or timestamp with an actual length of not greater than 255 bytes. A time zone in a string representation of a timestamp is ignored. For the valid formats of string representations of times and timestamps, see String representations of datetime values.
If expression is a TIMESTAMP WITH TIME ZONE value, expression is first cast to TIMESTAMP WITHOUT TIME ZONE, with the same precision as expression.
If expression is not a TIME value, expression is cast as follows:
- If expression is a TIMESTAMP WITH TIME ZONE value, expression is cast to TIMESTAMP WITHOUT TIME ZONE, with the same precision as expression.
- If expression is a string, expression is cast to TIME.
The result of the function is a time.
The result can be null; if the argument is null, the result is the null value.
The other rules depend on the data type of the argument:
- If the argument is a time
- the result is that time.
- If the argument is a timestamp
- the result is the time part of the timestamp.
- If the argument is a string
- the result is the time or time part of the timestamp represented by the string. If the CCSID of the string is not the same as the corresponding default CCSID at the server, the string is first converted to that CCSID.
The result CCSID is the appropriate CCSID of the argument encoding scheme and the result subtype is the appropriate subtype of the CCSID.
SELECT *
FROM CLASSES
WHERE TIME(STARTTM) = '13:30:00';