TIMESTAMP (timestamp without time zone)
Last updated: 2026-11-04
TIMESTAMP (timestamp without time zone)
TIMESTAMP (without time zone) combines a date and a time of day, ranging from 4713 BC to 294276 AD with microsecond precision in 8 bytes. It denotes a wall-clock reading and records no zone, so the same TIMESTAMP can mean different absolute instants in Beijing and New York. Choose it only when every participant is known to share one zone, or when the business genuinely means local wall time, such as "the shop opens at 09:00 every day".
| Kind | type |
|---|---|
| Example Language | SQL |
📝 Syntax
TIMESTAMP | TIMESTAMP WITHOUT TIME ZONE —— 8 bytes, microsecond precision
TIMESTAMP(precision) —— specifies fractional-second precision, default 6
Returns:Stores a date and time without a zone. Adding an INTERVAL yields a new timestamp, subtracting two TIMESTAMPs yields an INTERVAL, and extract(epoch FROM ...) produces a Unix timestamp, with zone-less timestamps interpreted as UTC.
▶ 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 | created_at | plus_1_day | epoch_seconds | col_type
----+----------------------------+----------------------------+---------------+-----------------------------
1 | 2024-03-15 10:30:00 | 2024-03-16 10:30:00 | 1710498600 | timestamp without time zone
2 | 2024-03-15 10:30:00.123456 | 2024-03-16 10:30:00.123456 | 1710498600 | timestamp without time zone
📌 Key Points
- extract(epoch FROM created_at) interprets a zone-less timestamp as UTC and returns seconds since 1970-01-01.
- Six fractional-second digits are kept by default; declaring timestamp(3) trims it to milliseconds and saves storage.
- TIMESTAMP silently discards any time zone offset in the input: '2024-03-15 10:30:00+08' is stored as 10:30:00, with the offset ignored rather than rejected, so it cannot record which zone a moment belongs to.