MySQL Current_date and Current_date() are the MySQL Date Functions, which are useful to return the current date value in YYYY-MM-DD or YYYYMMDD format. In this article, we show you how to get the Current date in MySQL with example.
MySQL CURRENT_DATE Syntax
The basic syntax of the Current_date in MySQL is as shown below:
MySQL Current Date Example
The below query shows you the basic use of this current date function.
TIP: Both these functions are the synonym of the CURDATE(). All those functions write the same output.
As you can see, it is showing today’s date in YYYY-MM-DD format.
The MySQL current Date function is a synonym for CURDATE(). Let me show you an example with all these three functions curdate(), current_date(), and current_date.
SELECT CURDATE() ;
The following query shows you what happens when we add days to the current_date(), current_date, and curdate functions in MySQL.
SELECT CURRENT_DATE() + 3;
SELECT CURRENT_DATE + 3;
SELECT CURDATE() + 3;
From the above image, they added those days to the current date. Next, they are displaying the date in YYYYMMDD string format
MySQL Current_Date Example 2
In this instance, we show how to use these functions as an argument of another function. This query finds the Day number from the current date
Similarly, below query finds the Month Number and Year Number from Current Date in MySQL