totn MariaDB Functions

MariaDB: CURDATE Function

This MariaDB tutorial explains how to use the MariaDB CURDATE function with syntax and examples.

Description

The MariaDB CURDATE function returns the current date.

Syntax

The syntax for the CURDATE function in MariaDB 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 MariaDB:

  • MariaDB 10

Example

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

For example:

SELECT CURDATE();
Result: '2014-05-18'

SELECT CURDATE() + 0;
Result: 20140518

SELECT CURDATE() + 1;
Result: 20140519