Data Engineering
TIME Data Type Compatibility Across Databases
A survey of the TIME data type across 14 databases, comparing supported ranges, maximum values, and whether the special value 24:00:00 is accepted.
A comprehensive survey of the TIME data type (not TIMESTAMP) across major relational and analytical databases, focusing on supported ranges, maximum values, and whether the special value 24:00:00 is accepted.
Note on 24:00:00: ISO 8601 allows
24:00:00to represent midnight at the end of a calendar day. Some databases support this, while others reject it. This distinction matters for applications that need to represent “end of day” semantics.
Supports 24:00:00
| Database | Range | Max Value | Docs |
|---|---|---|---|
| PostgreSQL | 00:00:00 to 24:00:00 | 24:00:00 | Link |
| IBM DB2 | 00:00:00 to 24:00:00 | 24:00:00 | Link |
| CockroachDB | 00:00:00 to 24:00:00 | 24:00:00 | Link |
| Redshift | 00:00:00 to 24:00:00 | 24:00:00 | Link |
| DuckDB | 00:00:00 to 24:00:00 | 24:00:00 | Link |
| MySQL | -838:59:59 to 838:59:59 | 838:59:59 | Link |
| MariaDB | -838:59:59 to 838:59:59 | 838:59:59 | Link |
| TiDB | -838:59:59 to 838:59:59 | 838:59:59 | Link |
| ClickHouse | -999:59:59 to 999:59:59 | 999:59:59 | Link |
Does NOT Support 24:00:00
| Database | Range | Max Value | Docs |
|---|---|---|---|
| SQL Server | 00:00:00 to 23:59:59 | 23:59:59 | Link |
| Snowflake | 00:00:00 to 23:59:59 | 23:59:59 | Link |
| BigQuery | 00:00:00 to 23:59:59 | 23:59:59 | Link |
| Firebird | 00:00:00 to 23:59:59 | 23:59:59 | Link |
| H2 | 00:00:00 to 23:59:59 | 23:59:59 | Link |
Detailed Notes
PostgreSQL
- Range:
00:00:00to24:00:00 - 24:00:00: Fully supported as the upper bound, representing midnight at the end of the day
- Source: PostgreSQL 18: Date/Time Types
MySQL
- Range:
-838:59:59to838:59:59 - 24:00:00: Supported —
24:00:00falls well within the valid range. The TIME type is designed to represent both time-of-day and elapsed time/intervals, which is why the range extends far beyond 24 hours. However,24:00:00is not given special “end of day” semantics as in PostgreSQL or DB2. - Source: MySQL 8.4: The TIME Type
MariaDB
- Range:
-838:59:59to838:59:59 - 24:00:00: Supported — same as MySQL,
24:00:00is a valid value within the extended range. - Source: MariaDB: TIME
SQL Server (Microsoft)
- Range:
00:00:00to23:59:59 - 24:00:00: Explicitly not supported. The documentation states: “Using hour 24 to represent midnight and leap second over 59 as defined by ISO 8601 are not supported to be backward compatible and consistent with the existing date and time types.” An hour value of 24 is documented as “not valid.”
- Source: SQL Server: time (Transact-SQL)
IBM DB2
- Range:
00:00:00to24:00:00 - 24:00:00: Fully supported. The documentation states: “A time is a three-part value representing a time of day in hours, minutes, and seconds, in the range of 00.00.00 to 24.00.00.”
- Source: IBM DB2 12: Date, time, and timestamp data types
CockroachDB
- Range:
00:00:00to24:00:00 - 24:00:00: Supported. The documentation notes this as a special feature: “An interesting feature that is only supported for TIME and TIMETZ is 24:00:00 time.” However, CockroachDB displays
TIME '24:00:00'as0000-01-01 00:00:00— to see the stored value, cast toSTRING. - Source: CockroachDB: TIME / TIMETZ
Snowflake
- Range:
00:00:00to23:59:59 - 24:00:00: Not supported.
- Source: Snowflake: Date & Time Data Types
Amazon Redshift
- Range:
00:00:00to24:00:00 - 24:00:00: Supported. The documentation states the range as
00:00:00to24:00:00. - Source: Amazon Redshift: Datetime types
Google BigQuery
- Range:
00:00:00to23:59:59 - 24:00:00: Not supported.
- Source: BigQuery: Data Types
Firebird
- Range:
00:00:00to23:59:59 - 24:00:00: Not supported.
- Note: The TIME type is only available in SQL Dialect 3.
- Source: Firebird 4.0: Data Types for Dates and Times
H2 Database
- Range:
00:00:00to23:59:59 - 24:00:00: Not supported.
- Source: H2: Data Types
DuckDB
- Range:
00:00:00to24:00:00 - 24:00:00: Supported.
- Source: DuckDB: Time Types
ClickHouse (v25.6+)
- Range:
-999:59:59to999:59:59 - 24:00:00: Supported — the TIME type supports values far beyond 24 hours (up to 999 hours), so
24:00:00is well within the valid range. Not treated as a special end-of-day value. - Note: Requires
SET enable_time_time64_type = 1. Introduced in version 25.6. - Source: ClickHouse: Date and Time Data Types
TiDB
- Range:
-838:59:59to838:59:59 - 24:00:00: Supported — same as MySQL,
24:00:00is a valid value within the extended range. Not treated as a special end-of-day sentinel. - Note: TiDB is MySQL-compatible, so its TIME type mirrors MySQL’s behavior.
- Source: TiDB: Date and Time Types