TIME (time of day without time zone)
Last updated: 2026-11-04
TIME (time of day without time zone)
TIME expresses a moment within a day, with neither date nor time zone, ranging from 00:00:00 to 24:00:00 with microsecond resolution stored as an 8-byte microsecond count. It fits opening hours, check-in times and scheduled daily jobs. Note that 24:00:00 is accepted, but it denotes a full 24 hours and is not equal to 00:00:00, so business rules are better off avoiding it.
| Kind | type |
|---|---|
| Example Language | SQL |
📝 Syntax
TIME | TIME WITHOUT TIME ZONE —— time of day, no zone, 8 bytes, microsecond precision
TIME(precision) —— specifies fractional-second precision
Returns:Stores a time of day at microsecond precision. Adding an INTERVAL yields a new time of day, and additions that cross midnight wrap around into the following day.
▶ Example
Runs real PostgreSQL 18 right in your browser (PGlite WASM, nothing to install). Press ▶ Run and the result appears in the panel below.
Output:
id | open_at | close_at | duration | col_type
----+----------+----------+----------+------------------------
1 | 09:00:00 | 18:30:00 | 09:30:00 | time without time zone
2 | 22:15:00 | 23:59:59 | 01:44:59 | time without time zone
📌 Key Points
- close_at - open_at returns an INTERVAL rendered as 09:30:00, not an integer number of minutes.
- 24:00:00 is valid input but is not equal to 00:00:00 (it sorts after it), while 25:00:00 raises "date/time field value out of range".
- TIME carries no date, so durations that span midnight depend on a business convention or require TIMESTAMP instead.
💡 Related Cases
More case studies coming soon.
📚 Related Reference
❓ FAQ
QTIME versus TIME WITH TIME ZONE?
ATIME carries no zone, it is only a clock reading; TIMETZ records an offset but has no date reference, which makes day boundaries and daylight saving error-prone. In practice use TIME together with DATE, or go straight to TIMESTAMPTZ.
QWhy is 24:00:00 confusing?
ABecause it is a legal boundary value denoting a full 24 hours, yet in comparisons it is not equal to 00:00:00 of the next day. Avoiding the ambiguity means sticking to the 00:00:00 to 23:59:59 range.