TIME represents the clock time of day (hours, minutes, seconds, fractional seconds) independent of any calendar date. In the SQL standard it can be declared with optional fractional-second precision and with or without an associated time-zone offset:• TIME[(p)] WITHOUT TIME ZONE – pure wall-clock time.• TIME[(p)] WITH TIME ZONE – wall-clock time plus offset from UTC.Precision p ranges from 0 to 9 digits depending on the database; p controls how many digits follow the decimal point in the seconds field. Storage size and range vary by vendor but the logical range is 00:00:00 through 23:59:59.[fraction].Because TIME has no date, arithmetic that crosses midnight can yield negative or wrapped results. For absolute time moments, use TIMESTAMP instead. TIME WITH TIME ZONE is not supported in some engines (e.g., MySQL, SQLite) even though the SQL standard defines it.
precision
(integer) - Optional number of fractional-second digits (0-9). Defaults to vendor-specific value, usually 6.WITHOUT TIME ZONE
(keyword) - Indicates the column stores local time only.WITH TIME ZONE
(keyword) - Indicates the column stores a time value plus an offset.DATE, TIMESTAMP, TIMESTAMP WITH TIME ZONE, INTERVAL, CAST, EXTRACT
SQL-92 Standard
Most engines let you specify 0 to 6 fractional-second digits. PostgreSQL goes to 6, SQL Server to 7, Oracle to 9. Omitting p uses the default (often 6).
No. Standard SQL limits TIME to 00:00:00 through 23:59:59.[fraction]. For durations longer than a day, use INTERVAL.
Cast one side to the other's type. Example for PostgreSQL: `CAST(ts AS TIME) = t` or `CAST(t AS TIMESTAMP WITH TIME ZONE)`.
It is defined by the SQL standard and implemented in PostgreSQL and Oracle but missing in MySQL and SQLite. Verify support before use.