MySQL Current Date

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 an example. The basic syntax of the Current_date in MySQL to display current date is shown below.

CURRENT_DATE;

CURRENT_DATE();

MySQL Current_Date Example

The below query shows you the basic use of this method.

SELECT CURRENT_DATE();

TIP: Both these Date methods are the synonym of the CURDATE(). All those methods write the same MySQL output.

MySQL Current Date Example 1

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 MySQL functions curdate(), current_date(), and current_date to get the current date.

SELECT CURRENT_DATE();

SELECT CURRENT_DATE;

SELECT CURDATE() ;
Todays Date Example 2

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;
Current_Date Example 3

From the above image, they added those days to the current dt. Next, they are displaying the same in YYYYMMDD string format

MySQL 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.

SELECT DAY(CURRENT_DATE());
MySQL Current_Date Example 4

Similarly, the below query finds the Month Number and Year Number.

SELECT YEAR(CURRENT_DATE);

SELECT MONTH(CURDATE());;
Current_Date Example 6

About Suresh

Suresh is the founder of TutorialGateway and a freelance software developer. He specialized in Designing and Developing Windows and Web applications. The experience he gained in Programming and BI integration, and reporting tools translates into this blog. You can find him on Facebook or Twitter.