Datetime
The datetime data type is used to store time-based information, such as dates and times. The following are some examples of datetime data types:
| Name | Storage size | Description |
| timestamp without time zone | 8 bytes | Both date and time (no time zone). For example, 2026-01-23 04:05:06. |
| timestamp with time zone | 8 bytes | Both date and time, with time zone. For example, 2026-01-23 04:05:06+02. Here, +02 indicates Eastern European Time (UTC+2). |
| date | 4 bytes | Date (no time of day). For example, 2026-01-23. |
| time without time zone | 8 bytes | Time of day (no date). For example, 04:05:06. |
| time with time zone | 12 bytes | Time of day (no date), with time zone. For example, 04:05:06+02. |
| interval | 16 bytes | Time interval. For example, 100 days. |
Table 2.4: Popular datetime data typesSimilar to strings, the text of date/time data types must be enclosed in single quotes when used in a SQL statement. For example, the date January 23, 2026 must be written as '2026-01-23' in a SQL statement...