PostgreSQL date/time types and current time functions
Short answer
In most cases, a combination of date, time, timestamp without time zone, and timestamp with time zone should provide a complete range of date/time functionality required by any application. (S1) Get the current time with current_timestamp (start of the transaction) or clock_timestamp() (changes during a statement). [S1][S2]
SELECT current_timestamp, statement_timestamp(), clock_timestamp();
SELECT now() AT TIME ZONE 'UTC';
Key points
transaction_timestamp()andstatement_timestamp()also return timestamptz. [S2]- The output format of the date/time types can be set to one of the four styles ISO 8601, SQL (Ingres), traditional POSTGRES (Unix date format), or German. (S1)
Claims
- id: C1 claim: timestamp without time zone stores date and time with no zone. source: S1 evidence: "both date and time (no time zone)"
- id: C2 claim: Output can be ISO 8601 with time zone as UTC offset. source: S1 evidence: "ISO 8601, with time zone as UTC offset"
- id: C3 claim: current_timestamp returns timestamp with time zone. source: S2 evidence: "current_timestamp → timestamp with time zone"
- id: C4 claim: clock_timestamp returns timestamp with time zone. source: S2 evidence: "clock_timestamp ( ) → timestamp with time zone"
Sources
- [S1] PostgreSQL: Documentation: 18: 8.5. Date/Time Types. PostgreSQL Global Development Group. https://www.postgresql.org/docs/current/datatype-datetime.html . License: PostgreSQL License. Accessed 2026-11-04.
- [S2] PostgreSQL: Documentation: 18: 9.9. Date/Time Functions and Operators. PostgreSQL Global Development Group. https://www.postgresql.org/docs/current/functions-datetime.html . License: PostgreSQL License. Accessed 2026-11-04.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: PostgreSQL Global Development Group, PostgreSQL: Documentation: 18: 8.5. Date/Time Types, PostgreSQL License; PostgreSQL Global Development Group, PostgreSQL: Documentation: 18: 9.9. Date/Time Functions and Operators, PostgreSQL License.
Cite this
iinventedlight. 2026. "PostgreSQL date/time types and current time functions." iinventedlight Library, iil:note:yn7mpned, version of 2026-11-04. https://iinventedlight.com/library/notes/postgres-date-time-types/. License: CC-BY-4.0.
@misc{iil_note_yn7mpned,
author = {{iinventedlight}},
title = {{PostgreSQL date/time types and current time functions}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-04},
url = {https://iinventedlight.com/library/notes/postgres-date-time-types/},
note = {Permanent ID iil:note:yn7mpned. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/postgres-date-time-types.md.