Mysql Current_date Function

MySQL: CURRENT_DATE Function

This tutorial explains how to use the MySQL CURRENT_DATE function with syntax and examples.

Description

The MySQL CURRENT_DATE function returns the current date.

Syntax

The syntax for the CURRENT_DATE function in MySQL is:

CURRENT_DATE( )

Parameters or Arguments

There are no parameters or arguments for the CURRENT_DATE function.

Note

  • The CURRENT_DATE function will return the current date as a 'YYYY-MM-DD' format, if used in a string context.
  • The CURRENT_DATE function will return the current date as a YYYYMMDD format, if used in a numeric context.
  • The CURRENT_DATE function is a synonym for the CURDATE function.

Applies To

The CURRENT_DATE function can be used in the following versions of MySQL:

  • MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0, MySQL 3.23

Example

Let's look at some MySQL CURRENT_DATE function examples and explore how to use the CURRENT_DATE function in MySQL.

For example:

mysql> SELECT CURRENT_DATE();
Output: '2014-01-28'

mysql> SELECT CURRENT_DATE() + 0;
Output: 20140128

mysql> SELECT CURRENT_DATE() + 1;
Output: 20140129