MySQL Current_date and Current_date() are the 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 with example. 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 method.
As you can see, it is showing today’s date in YYYY-MM-DD format.
This 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 and curdate functions.
SELECT CURRENT_DATE() + 3;
SELECT CURRENT_DATE + 3;
SELECT CURDATE() + 3;
From the above image, they added those days to the current dt. Next, they are displaying the same in YYYYMMDD string format
Current Date Example 2
In this instance, we show how to use these functions as an argument of another. This query finds the Day number from the current dt
Similarly, below query finds the Month Number and Year Number.