CURRENT_DATE

SQL · Date Functions

Theory

CURRENT_DATE gives you today's date, read from the database server's clock at the moment the query runs. It returns a DATE value with no time part, such as 2026-11-08. Because it is a special keyword defined by the SQL standard, most databases write it without parentheses: SELECT CURRENT_DATE.

Its real power shows up when you combine it with other date logic. For example, WHERE order_date >= CURRENT_DATE - 7 (or the dialect's equivalent) means 'orders from the last week', and the query keeps working tomorrow without anyone editing a hard-coded date. PostgreSQL, MySQL, Oracle, Snowflake and SQLite all accept CURRENT_DATE; SQL Server traditionally uses CAST(GETDATE() AS DATE). The date is based on the server's (or session's) time zone, so a server in UTC may already be on 'tomorrow' for a user in Jaipur.

Why we use it

Reports and filters often need to be relative to today: last 7 days, overdue invoices, age of a record. CURRENT_DATE lets the query compute 'today' itself, so it never goes stale like a hard-coded date literal does.

When to use it

Use it for rolling filters, default values of date columns and age or overdue calculations. If you need the time too, use CURRENT_TIMESTAMP. For repeatable tests or backfills, pass a fixed date instead so results do not change daily.

How it works

  1. Query starts running
  2. Database reads the server clock once
  3. Keep only the date part (no hours/minutes)
  4. Used in a comparison or arithmetic? Yes: Compare or shift it (today - 7). No: Return it as a date.
  5. Result reflects the date on the day it runs

Syntax

CURRENT_DATE

Example

SELECT CURRENT_DATE;

Key points

SQL topics

Introduction to SQL

Querying Data

Sorting Rows

Limiting Rows

Filtering Rows

Joining Multiple Tables

Grouping Rows

SET Operators

Working with Tables

Modifying Data

Views & Triggers

Conditional Expressions

SQL Subqueries

Aggregate Functions

Window Functions

String Functions

Date Functions

Math Functions

Extra Concepts

T
Tech Town
Log InSign Up Free
Home SQL Python DSA Power BI Snowflake Databricks Spark Gen AI Practice Problems Contest Blog

Master SQL from Zero to Pro

All SQL topics in one place. Click any topic in the sidebar — content opens right here without leaving the page.

{{ sectionCount }}
Sections
{{ topicCount }}
Topics
Free
Forever
Hands-on practice Practice SQL Online Solve 150 SQL interview problems in a live editor with instant checking. Start practising →
Section {{ sec.num }}

{{ sec.label }}

SQL  /  {{ current.sectionLabel }}  /  {{ current.name }}

{{ current.name }}

Theory

{{ current.def }}

Why we use it

{{ rich.why }}

When to use it

{{ rich.when }}

Diagram

{{ rich.dg.caption }}

{{ tb.title }}
{{ c.v }}
{{ rich.dg.op }}
➜
{{ rich.dg.output.title }}
{{ c.v }}
{{ nd.label }}
{{ nd.sub }}
{{ nd.label }}
{{ nd.sub }}
{{ rich.dg.left.title }}
{{ it }}
{{ rich.dg.right.title }}
{{ it }}
Flowchart — how it works
{{ nd.text }}
{{ nd.text }}
◇ {{ nd.text }}
Yes → {{ nd.yes }}
No → {{ nd.no }}
Syntax
{{ current.syntax }}
Example
{{ current.example }}
▶ Try It Live — runs against a real sample database
{{ liveError }}
{{ col }}
{{ cell }}
Key Points — click to check off as you learn
  • {{ pt.mark }} {{ pt.text }}

Share this topic