MySQL: CURDATE Function

  • Post author:
  • Post category:MySQL
  • Post comments:1 Comment
MySQL CURDATE Function

In this guide, we will explain how to use the MySQL CURDATE function with syntax and examples.

Description

The MySQL CURDATE function returns the current date.

Syntax

The syntax for the CURDATE function in MySQL is:

CURDATE( )

Parameters or Arguments

There are no parameters or arguments for the CURDATE function.

Note

  • The CURDATE function will return the current date as a ‘YYYY-MM-DD’ format, if used in a string context.
  • The CURDATE 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 CURDATE function can be used in the following versions of :

  • 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 CURDATE function examples and explore how to use the CURDATE function.

For example:

mysql> SELECT CURDATE();
Result: '2014-01-28'

mysql> SELECT CURDATE() + 0;
Result: 20140128

mysql> SELECT CURDATE() + 1;
Result: 20140129

Next Topic : Click Here

This Post Has One Comment

Leave a Reply