SQL CURRENT_DATE: Syntax, Examples and Today's Date Queries

By Dr. Zubair Khalid, DVM, MS, PhD ·

SQL CURRENT_DATE: Syntax, Examples and Today's Date Queries

To get the current date in SQL, use the CURRENT_DATE keyword, which returns today's date with no time component. To find rows dated today, compare your date column to CURRENT_DATE in a WHERE clause. The exact function name varies by database, so the sections below cover the standard form and the common dialect alternatives.

Quick Answer

  • CURRENT_DATE returns today's date as a DATE value with no time part.
  • It takes no parentheses in standard SQL, so write CURRENT_DATE, not CURRENT_DATE().
  • To filter rows dated today, use WHERE date_column = CURRENT_DATE.
  • If your column stores a timestamp, cast it first, for example WHERE CAST(ts AS DATE) = CURRENT_DATE.
  • SQLite accepts CURRENT_DATE too, and date('now') is its equivalent function form. Both return the current UTC date as YYYY-MM-DD text.

Syntax

CURRENT_DATE is a keyword, not a function that accepts arguments. The table below covers the forms you will meet.

NameRequired?Meaning
CURRENT_DATEYesReturns the current date, typically as DATE
CURRENT_DATE()Dialect dependentParentheses form accepted by some engines, same result
CURRENT_TIMESTAMPNoReturns current date and time together
NOW()NoReturns current date and time in several dialects
date('now')NoSQLite expression that returns the current date

The standard spelling is CURRENT_DATE. PostgreSQL documents current_date as returning the current date, alongside current_timestamp and localtimestamp for date and time values [1].

How It Works

CURRENT_DATE is evaluated once per statement. Every row in the result set sees the same value, so you do not get a date that shifts halfway through a long query.

The value is a date, not a string. That matters because comparison rules differ. When you compare a date column to CURRENT_DATE, the database compares dates. When you compare a text column to CURRENT_DATE, the database may convert one side to the other, and the result depends on the engine.

The date comes from the server, not from your machine. If you run a query against a remote database, "today" means today in the server's time zone. A server set to UTC can report tomorrow's date while you are still in yesterday locally.

For timestamp columns, the comparison is stricter. A timestamp of 2026-10-03 09:15:00 is not equal to the date 2026-10-03, because one has a time part and the other does not. You need to strip the time first.

Worked Example

The orders table below holds five orders, three placed today and two placed earlier. The goal is to return only the orders dated today.

order_idorder_date
12026-10-03
22026-10-02
32026-10-03
42026-10-01
52026-10-03
SELECT order_id, order_date FROM orders WHERE order_date = date('now');

The query runs in four steps. SELECT order_id, order_date chooses the columns to display. FROM orders reads rows from the table. WHERE order_date = date('now') keeps only rows whose order_date equals today's date. date('now') is the SQLite function that returns the current date as YYYY-MM-DD.

order_idorder_date
12026-10-03
32026-10-03
52026-10-03

The result was checked with an equivalent SQLite query. Orders 2 and 4 drop out because their dates are one and two days behind today.

More Examples

Filter a timestamp column. Cast the timestamp to a date so the time part does not block the match.

SELECT order_id, created_at
FROM orders
WHERE CAST(created_at AS DATE) = CURRENT_DATE;

Filter a range instead of a single day. A range avoids casting and can use an index on the timestamp column.

SELECT order_id, created_at
FROM orders
WHERE created_at >= CURRENT_DATE
  AND created_at < CURRENT_DATE + INTERVAL '1 day';

Count today's rows. Combine the filter with an aggregate to get a daily total. The same pattern works with any aggregate, as shown in the guide to the SQL COUNT function.

SELECT COUNT(*) AS orders_today
FROM orders
WHERE order_date = CURRENT_DATE;

Return yesterday's rows. Subtract an interval from the current date.

SELECT order_id, order_date
FROM orders
WHERE order_date = CURRENT_DATE - INTERVAL '1 day';

Label the current date in the output. Select the value directly to see what the server thinks today is.

SELECT CURRENT_DATE AS today;

If you need to move between date arithmetic and difference calculations, the SQL DATEADD and DATEDIFF guide covers the interval side, and the SQL DATEDIFF function guide covers the difference side.

Errors and How to Fix Them

Function does not exist. Some engines reject CURRENT_DATE() with parentheses. Drop them and write CURRENT_DATE.

Wrong day in SQLite. SQLite's CURRENT_DATE and date('now') both return the UTC date. Use date('now', 'localtime') if you need the machine's local date.

Operator does not exist: text = date. You compared a text column to a date. Cast the column, for example CAST(order_date AS DATE) = CURRENT_DATE.

Invalid input syntax for type date. You compared a date column to a string in the wrong format. Use CURRENT_DATE rather than a hand-written literal.

Wrong day returned. The server time zone differs from yours. Check the server setting before trusting the result.

Common Mistakes

  • Writing CURRENT_DATE() in a dialect that rejects it. The standard form takes no parentheses. Remove them if you get a syntax error.
  • Comparing a timestamp column directly to CURRENT_DATE. The time part prevents a match. Cast the column to a date or use a half-open range.
  • Assuming the date is local to you. CURRENT_DATE follows the server clock. Confirm the server time zone when the day boundary matters.
  • Storing dates as text in mixed formats. Text comparisons then depend on formatting rules. Store dates in a date type, or keep one consistent format.
  • Using CURRENT_DATE inside a stored value. If you save today's date into a column, it freezes. Compute it at query time instead.
  • Forgetting that the value is fixed per statement. A long-running query does not roll over at midnight. Do not expect the date to change mid-execution.

Limitations

CURRENT_DATE gives you one day, the server's day. It cannot tell you the user's local date, and it cannot adjust for daylight saving on its own. When a report must follow a specific time zone, convert explicitly instead of relying on the default.

The keyword also says nothing about data quality. If your date column holds text, nulls, or mixed formats, the comparison may silently miss rows. A row with a null date never equals CURRENT_DATE, and a row stored as 10/03/2026 will not match a date value. Check the column type before you trust a count.

Frequently Asked Questions

What is the current date in SQL?

CURRENT_DATE returns today's date as a date value with no time part. It takes no arguments and is evaluated once per statement, so every row sees the same value. In SQLite, CURRENT_DATE and date('now') both work and return the UTC date.

How do I write a SQL query where the date is today?

Compare the column to CURRENT_DATE in the WHERE clause, as in WHERE order_date = CURRENT_DATE. If the column holds a timestamp, cast it to a date first or use a range from today to tomorrow. The SQL WHERE date is today guide walks through both patterns.

Why does my date today SQL query return no rows?

The most common cause is a timestamp column compared to a date, which never matches because of the time part. The second cause is a text column in a format the database cannot convert. Check the column type, then cast or use a range.

Is CURRENT_DATE the same as NOW()?

No. CURRENT_DATE returns only the date. NOW() and CURRENT_TIMESTAMP return the date and time together. Use the date form when you filter by day, and the timestamp form when you need the exact moment.

How do I get yesterday's or tomorrow's date?

Add or subtract an interval from CURRENT_DATE, for example CURRENT_DATE - INTERVAL '1 day' for yesterday. The interval syntax varies by dialect, so check your engine. For date arithmetic across dialects, see the SQL DATEADD and DATEDIFF guide.

Can I format the current date in SQL?

Yes, but the function differs by dialect. MySQL uses DATE_FORMAT, SQL Server uses FORMAT or CONVERT, and PostgreSQL uses to_char. The SQL convert date guide compares the common formats.

References

  1. PostgreSQL: Documentation: 18: 9.9. Date/Time Functions and Operators

Further Reading

Related Articles