SQL NOW / CURRENT_TIMESTAMP function
Returns the current date and time. CURRENT_TIMESTAMP is the standard spelling and works on all five engines; NOW(), GETDATE() and SYSDATE are dialect names that differ in precision and in when they are evaluated.
- Category
- Dates & times
- Returns
timestamp (text on SQLite)- In this category
- 1 of 121
Syntax
CURRENT_TIMESTAMP
NOW()
GETDATE() / SYSDATETIME()
SYSTIMESTAMP
datetime('now')
Each block is a separate form. The support table and the examples show which engine takes which.
Engine support
| Engine | Support | Notes |
|---|---|---|
| SQL Server | Yes | CURRENT_TIMESTAMP or GETDATE() (datetime); SYSDATETIME() for datetime2; no NOW() |
| PostgreSQL | Yes | Supported under this name. |
| MySQL | Yes | NOW() and CURRENT_TIMESTAMP give the statement start; SYSDATE() the moment of the call |
| SQLite | Yes | CURRENT_TIMESTAMP or datetime('now'); returns UTC text, no NOW() |
| Oracle | Yes | CURRENT_TIMESTAMP (session zone), SYSTIMESTAMP and SYSDATE (server clock); no NOW() |
Examples
Any engine
SELECT CURRENT_TIMESTAMP AS loaded_at;
SQL Server
SELECT SYSDATETIME() AS loaded_at;
SQLite
SELECT datetime('now', 'localtime') AS loaded_at;
Good to know
- PostgreSQL's now() and CURRENT_TIMESTAMP are the transaction start time, frozen for the whole transaction; clock_timestamp() keeps moving.
- SQLite's CURRENT_TIMESTAMP and datetime('now') return UTC text like '2026-08-01 14:30:00', not local time. datetime('now', 'localtime') converts.
- Precision differs: SQL Server's GETDATE() and CURRENT_TIMESTAMP are datetime, accurate to about 3 ms; SYSDATETIME() is datetime2 with 100 ns. MySQL's NOW() has whole seconds unless you ask for NOW(6).
- Oracle's SYSDATE and SYSTIMESTAMP read the database server's clock and time zone; CURRENT_TIMESTAMP uses the session time zone, so two clients in different zones see different values.
Questions about NOW / CURRENT_TIMESTAMP
Is NOW() the time the statement ran?
On PostgreSQL it is the time the transaction started, so every statement in the transaction sees the same value. MySQL's NOW() is the time the statement started; its SYSDATE() changes even within one statement. SQL Server evaluates GETDATE() once per reference in a query, not per row.
Why is SQLite's datetime('now') in the wrong time zone?
It is UTC by design. Add 'localtime' as a modifier to get the machine's local time, or keep storing UTC and convert for display, which survives daylight-saving changes and servers moving zones.
Browse every function in the SQL function reference, or see what the SQLly desktop app does for your database.
Related on SQLly
- Current timestamp and its precision in SQL Server, PostgreSQL, MySQL, SQLite and Oracle Dialect comparison
- Date difference filters in WHERE Dialect comparison
- Interval literals for date arithmetic in SQL Server, PostgreSQL, MySQL, SQLite and Oracle Dialect comparison
- Convert a timestamp to another timezone in SQL Server, PostgreSQL, MySQL, SQLite and Oracle Dialect comparison
- Format a date as text in SQL Server, PostgreSQL, MySQL, SQLite and Oracle Dialect comparison
- Truncate a date to day, month or year in SQL Server, PostgreSQL, MySQL, SQLite and Oracle Dialect comparison
Cheat sheets for the engines that have it: PostgreSQL, MySQL, SQL Server, SQLite, Oracle.
Functions your engine actually has
SQLly's completion lists the built-in functions of the engine you're connected to, whether that's SQL Server, PostgreSQL, MySQL, SQLite or Oracle. Hover a function for help, and signature hints show each argument as you type.