MySQL CURDATE Function

MySQL Curdate is a Date Function, which is useful to return the current date value in YYYY-MM-DD or YYYYMMDD format. The syntax of the Curdate Function is as shown below:

CURDATE();

MySQL CURDATE Example

The following query shows you the basic use of this curdate function.

SELECT CURDATE();
2019-02-19

It is showing today’s date in YYYY-MM-DD format. Let me show you another Dt method example with an Alias Name.

SELECT CURDATE() AS 'Todays Date';
MySQL CURDATE Example 2

The following MySQL query shows you what happens when adding days to this curdate function.

SELECT CURDATE() + 2 AS 'Date String';

SELECT CURDATE() + 12 AS 'Date String';

It added those days to the current date. Next, it displays the date in the YYYYMMDD string format.

MySQL CURDATE Example 4