← All notes

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

Claims

Sources

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

Permanent ID: iil:note:yn7mpned

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.},
}

Markdown

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.