SQL CURRENT_DATE function
Returns today's date with no time part on most engines, which makes it the usual lower bound for today's rows: WHERE created_at >= CURRENT_DATE.
- Catégorie
- Dates & times
- Returns
date (text on SQLite)- In this category
- 2 of 121
Syntaxe
CURRENT_DATE
CURDATE() -- MySQL
CAST(GETDATE() AS date) -- SQL Server before 2025
Each block is a separate form. The support table and the examples show which engine takes which.
Prise en charge des moteurs
| Moteur | Support | Notes |
|---|---|---|
| SQL Server | Oui | CURRENT_DATE from SQL Server 2025; CAST(GETDATE() AS date) before that |
| PostgreSQL | Oui | Supported under this name. |
| MySQL | Oui | CURRENT_DATE, CURRENT_DATE() and CURDATE() |
| SQLite | Oui | CURRENT_DATE returns UTC text 'YYYY-MM-DD' |
| Oracle | Different name or syntax | CURRENT_DATE keeps the time of day; TRUNC(SYSDATE) for midnight |
Exemples
PostgreSQL
-- also MySQL, SQLite and SQL Server 2025 SELECT COUNT(*) FROM orders WHERE created_at >= CURRENT_DATE;
SQL Server
SELECT CAST(GETDATE() AS date) AS today;
Oracle
SELECT COUNT(*) FROM orders WHERE created_at >= TRUNC(SYSDATE);
Bon à savoir
- Older SQL Server has no CURRENT_DATE; SQL Server 2025 and Azure SQL added it. CAST(GETDATE() AS date) works on every version.
- Oracle's CURRENT_DATE is a DATE, and Oracle DATEs carry a time: it returns the current date and time in the session time zone. Use TRUNC(CURRENT_DATE) or TRUNC(SYSDATE) for today at midnight.
- SQLite's CURRENT_DATE is the UTC date. On a machine east or west of UTC it can be tomorrow or yesterday near midnight.
- CURRENT_DATE uses the session time zone on PostgreSQL and MySQL, so the same instant can be different days in two sessions.
Questions about CURRENT_DATE
Does SQL Server have CURRENT_DATE?
SQL Server 2025 and Azure SQL Database do. On earlier versions, CAST(GETDATE() AS date) or CAST(SYSDATETIME() AS date) returns the date without the time.
Why is SQLite's CURRENT_DATE a different day?
It reads UTC. Near midnight, UTC can already be tomorrow or still be yesterday where you are. date('now', 'localtime') returns the local date.
Does Oracle's CURRENT_DATE include the time?
Yes. Oracle's DATE type always stores a time of day, and CURRENT_DATE returns the current date and time in the session time zone. TRUNC(CURRENT_DATE) gives midnight.
Browse every function in the SQL function reference, or see what the SQLly desktop app does for your database.
Related on SQLly
Cheat sheets for the engines that have it: SQL Server, PostgreSQL, MySQL, 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.