CURRENT_DATE()
Returns today's date (no time component).
Description
CURRENT_DATE returns the current date according to the database server's
clock, with no time-of-day portion. It's a zero-argument function (no parentheses
needed in standard SQL) used for "as of today" comparisons like filtering
records up to now.
Syntax
CURRENT_DATEParameters
None.
Return Type
Returns a DATE.
Examples
Employees & Departments
Loading database engine...
Employees & Departments
Loading database engine...
Compare to today
WHERE hire_date >= CURRENT_DATE - INTERVAL '1 year' finds hires in the last
year without hard-coding a date.
Common Mistakes
- Adding parentheses. In standard SQL it's
CURRENT_DATE, notCURRENT_DATE(). Some engines accept both; others don't. - Time component. It has no time; comparing to a timestamp compares at midnight.
- Time zones. The value reflects the server's time zone setting.
Related Functions
See also: CURRENT_TIMESTAMP, NOW, EXTRACT.