MySQL CURRENT_DATE() Function
In MySQL, the CURRENT_DATE()
function returns the system’s current date in YYYY-MM-DD
or YYYYMMDD
format.
The function is exactly the same as the CURDATE()
function.
CURRENT_DATE()
Syntax
Here is the syntax of MySQL CURRENT_DATE()
function:
CURRENT_DATE()
CURRENT_DATE()
Examples
Returns the current date for the system.
SELECT
CURRENT_DATE(),
CURRENT_DATE() + 0;
+-----------------+--------------------+
| CURRENT_DATE() | CURRENT_DATE() + 0 |
+-----------------+--------------------+
| 2022-04-12 | 20220412 |
+-----------------+--------------------+
Note: The result of CURRENT_DATE() + 0
is in the YYYYMMDD
format.
CURRENT_DATE() + N
means adding N
days to the current date. For example, the following statments is used to add 1 day to the current date:
SELECT CURRENT_DATE() + 1;
+--------------------+
| CURRENT_DATE() + 1 |
+--------------------+
| 20220413 |
+--------------------+