select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

FUNCTIONS / UUID FUNCTIONS

uuid_extract_timestamp

Read PG 18 manual ↗

Extracts a timestamp with time zone from a UUID of version 1 or 7.

Signatures & examples

uuid_extract_timestamp ( uuid ) → timestamp with time zone
Extracts a timestamp with time zone from a UUID of version 1 or 7. For other versions, this function returns null. Note that the extracted timestamp is not necessarily exactly equal to the time the UUID was generated; this depends on the implementation that generated the UUID.
uuid_extract_timestamp('019535d9-3df7-79fb-b466-​fa907fa17f9e'::uuid) → 2025-02-23 21:46:24.503-05
Version history 3
  1. PG 19 → 20changed
  2. PG 17 → 18changed
  3. PG 16 → 17added

Definition snapshot: 2026-09-14T13:14:25.684213+00:00@99e6866c · English manual source