CURRENT_TIMESTAMP()
Returns the current date and time (with time zone in some engines).
Description
CURRENT_TIMESTAMP returns the current date and time according to the server's
clock, including the time of day (and often the session time zone). It's a
zero-argument function used for audit columns, "now" comparisons, and
time-based defaults.
Syntax
CURRENT_TIMESTAMPParameters
None.
Return Type
Returns a TIMESTAMP (or TIMESTAMPTZ where time zones are tracked).
Examples
Employees & Departments
Loading database engine...
Employees & Departments
Loading database engine...
CURRENT_TIMESTAMP vs NOW
They're usually equivalent. NOW() is a function-call form; CURRENT_TIMESTAMP
is the standard keyword form.
Common Mistakes
- Adding parentheses. Standard SQL uses
CURRENT_TIMESTAMPwithout(). - Time zone assumptions. The value may be in UTC or the session zone; be explicit when comparing across zones.
- Re-evaluation. In some engines it's fixed for the transaction; in others it can vary per row — know your database.
Related Functions
See also: CURRENT_DATE, NOW, EXTRACT.