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:00 to 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

DatabaseRangeMax ValueDocs
PostgreSQL00:00:00 to 24:00:0024:00:00Link
IBM DB200:00:00 to 24:00:0024:00:00Link
CockroachDB00:00:00 to 24:00:0024:00:00Link
Redshift00:00:00 to 24:00:0024:00:00Link
DuckDB00:00:00 to 24:00:0024:00:00Link
MySQL-838:59:59 to 838:59:59838:59:59Link
MariaDB-838:59:59 to 838:59:59838:59:59Link
TiDB-838:59:59 to 838:59:59838:59:59Link
ClickHouse-999:59:59 to 999:59:59999:59:59Link

Does NOT Support 24:00:00

DatabaseRangeMax ValueDocs
SQL Server00:00:00 to 23:59:5923:59:59Link
Snowflake00:00:00 to 23:59:5923:59:59Link
BigQuery00:00:00 to 23:59:5923:59:59Link
Firebird00:00:00 to 23:59:5923:59:59Link
H200:00:00 to 23:59:5923:59:59Link

Detailed Notes

PostgreSQL

  • Range: 00:00:00 to 24: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:59 to 838:59:59
  • 24:00:00: Supported — 24:00:00 falls 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:00 is not given special “end of day” semantics as in PostgreSQL or DB2.
  • Source: MySQL 8.4: The TIME Type

MariaDB

  • Range: -838:59:59 to 838:59:59
  • 24:00:00: Supported — same as MySQL, 24:00:00 is a valid value within the extended range.
  • Source: MariaDB: TIME

SQL Server (Microsoft)

  • Range: 00:00:00 to 23: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:00 to 24: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:00 to 24: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' as 0000-01-01 00:00:00 — to see the stored value, cast to STRING.
  • Source: CockroachDB: TIME / TIMETZ

Snowflake

Amazon Redshift

Google BigQuery

Firebird

H2 Database

  • Range: 00:00:00 to 23:59:59
  • 24:00:00: Not supported.
  • Source: H2: Data Types

DuckDB

ClickHouse (v25.6+)

  • Range: -999:59:59 to 999:59:59
  • 24:00:00: Supported — the TIME type supports values far beyond 24 hours (up to 999 hours), so 24:00:00 is 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:59 to 838:59:59
  • 24:00:00: Supported — same as MySQL, 24:00:00 is 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
#Data Engineering #SQL #Databases #TIME #DuckDB #PostgreSQL #MySQL