PostgreSQL 18 reference · Date and Time Functions

PostgreSQL NOW() Function

Return the current date and time with time zone, fixed at the start of the transaction. current_timestamp is the same.

PostgreSQL 18

Create a free account to save this page, take notes and track your progress. Sign in

Syntax

now()  |  current_timestamp  |  clock_timestamp()

Return value

timestamp with time zone.

Examples

now() and current_timestamp
SELECT now() = current_timestamp AS same_value, now() > '2026-01-01' AS after_2026;

Output

 same_value | after_2026
------------+------------
 t          | t
(1 row)

Run this on your computer — see “Get Started” for setup.

now() vs clock_timestamp()
SELECT now() = now() AS fixed_in_transaction, clock_timestamp() >= now() AS clock_moves_on;

Output

 fixed_in_transaction | clock_moves_on
----------------------+----------------
 t                    | t
(1 row)

Run this on your computer — see “Get Started” for setup.

now() returns the same value for the whole transaction, so rows inserted together share a timestamp. Use clock_timestamp() when you need the time at the moment of the call.

In other languages

Was this page helpful?