TIME

Description

TIME data type consists of hour, minute and second. A TIME literal is represented as a character string. The character string follows the TIME keyword as shown below.

TIME 'hh:mm [:ss] [am | pm]'

hh is the hour, mm is the minute, and ss is the second. If there is no second entered, 0 will be specified automatically.
Time is automatically converted to 24-hour clock format.

Note

All items must be entered in integral form.

You can enter time using either 12-hour clock(AM/PM) format or 24-hour clock format, but the CSQL always uses AM/PM format to display time. You can also use AM/PM format even when entering time in 24-hour clock format; this is allowed only when the input value and the AM/PM value converted from the input value match.

All time values are stored in 24-hour clock format; The C-API function db_time_decode returns time values in 24-hour clock format.

Example

TIME '1:15:45 pm' is stored as '01:15:45 PM'.
TIME '16:08:33 am' is an error (because the input value does not match the AM/PM value).
TIME '16:08:33 pm' is stored as '04:08:33 PM'.
TIME '1:15' is stored as '01:15:00 AM'.