Language
日本語
English

Caution

JavaScript is disabled in your browser.
This site uses JavaScript for features such as search.
For the best experience, please enable JavaScript before browsing this site.

  1. Home
  2. SQL Dictionary
  3. CURRENT_DATE / NOW

CURRENT_DATE / NOW

Since: SQL-92(1992)

Functions and expressions for retrieving the current date or datetime. Use these when you need to reference the system clock in SQL.

Syntax

Returns the current date (standard SQL).

SELECT CURRENT_DATE;

Returns the current time (standard SQL).

SELECT CURRENT_TIME;

Returns the current datetime (standard SQL).

SELECT CURRENT_TIMESTAMP;

Returns the current datetime (MySQL function).

SELECT NOW();

Returns the datetime at the moment the query executes (MySQL).

SELECT SYSDATE();

Syntax List

SyntaxDescription
CURRENT_DATEReturns the current date as a DATE value (YYYY-MM-DD format). No parentheses are needed in standard SQL.
CURRENT_TIMEReturns the current time as a TIME value (HH:MM:SS format). No parentheses are needed in standard SQL.
CURRENT_TIMESTAMPReturns the current datetime as a TIMESTAMP value. No parentheses are needed in standard SQL.
NOW()Returns the current datetime in MySQL. It returns the time at which the statement began executing.
SYSDATE()Returns the datetime at the moment of SQL execution in MySQL. Unlike NOW(), it may return a different value each time it is called within the same statement.

Sample Code

The following examples use the members table.

members member_id name expire_date 1 user_a 2026-03-31 2 user_c 2025-12-31 3 user_e 2026-06-30 3 rows in set

Retrieves the current date.

sample_current_date_now.sql
SELECT CURRENT_DATE AS today;
+------------+
| today      |
+------------+
| 2026-03-16 |
+------------+
1 row in set

Retrieves the current datetime.

sample_current_date_now.sql
SELECT NOW() AS current_datetime;
+---------------------+
| current_datetime    |
+---------------------+
| 2026-03-16 14:32:07 |
+---------------------+
1 row in set

Retrieves members whose subscription is still valid (expire date is today or later).

sample_current_date_now.sql
SELECT member_id, name, expire_date
FROM members
WHERE expire_date >= CURRENT_DATE;
+-----------+--------+-------------+
| member_id | name   | expire_date |
+-----------+--------+-------------+
|         1 | user_a | 2026-03-31  |
|         3 | user_e | 2026-06-30  |
+-----------+--------+-------------+
2 rows in set

Updates the expiration date to the current datetime.

sample_current_date_now.sql
UPDATE members
SET expire_date = NOW()
WHERE member_id = 2;
Query OK, 1 row affected (0.01 sec)

The following is an example:

SELECT member_id, name, expire_date
FROM members
WHERE member_id = 2;
+-----------+--------+---------------------+
| member_id | name   | expire_date         |
+-----------+--------+---------------------+
|         2 | user_c | 2026-03-16 14:32:07 |
+-----------+--------+---------------------+
1 row in set

Retrieves members whose membership has expired.

sample_current_date_now.sql
SELECT member_id, name, expire_date
FROM members
WHERE expire_date < CURRENT_DATE;
+-----------+--------+-------------+
| member_id | name   | expire_date |
+-----------+--------+-------------+
|         2 | user_c | 2025-12-31  |
+-----------+--------+-------------+
1 row in set

Syntax by Database

CURRENT_DATE, CURRENT_TIME, and CURRENT_TIMESTAMP are standard SQL expressions supported by MySQL, PostgreSQL, and SQLite.

SELECT CURRENT_DATE;
SELECT CURRENT_TIMESTAMP;

In Oracle, CURRENT_DATE returns a datetime value. If you only need the date portion, use TRUNC(SYSDATE). To retrieve the current datetime, use SYSDATE.

-- Retrieves the current datetime (Oracle).
SELECT SYSDATE FROM DUAL;

-- Retrieves the current timestamp (Oracle).
SELECT CURRENT_TIMESTAMP FROM DUAL;

In SQL Server, CURRENT_TIMESTAMP is available. For higher-precision datetime values, use SYSDATETIME(). Since CURRENT_DATE is not supported, use CAST(GETDATE() AS DATE) as an alternative.

-- Retrieves the current datetime (SQL Server).
SELECT CURRENT_TIMESTAMP;
SELECT GETDATE();

-- Retrieves the current date only (SQL Server).
SELECT CAST(GETDATE() AS DATE);

Notes

CURRENT_DATE, CURRENT_TIME, and CURRENT_TIMESTAMP are expressions defined in standard SQL and work in both MySQL and PostgreSQL. NOW(), on the other hand, is a MySQL-specific function that returns the time at which the statement began. It returns the same value across multiple calls within a transaction, ensuring consistency.

SYSDATE() returns the actual time of SQL execution, so it may return different values within the same statement each time it is called. In most cases, using NOW() is the safer choice.

To add or subtract dates, see DATE_ADD / DATEDIFF. To extract the year or month from a date, see EXTRACT / FORMAT.

If you find any errors or copyright issues, please .