totn MariaDB Functions

MariaDB: CURRENT_DATE Function

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

Description

The MariaDB CURRENT_DATE function returns the current date.

Syntax

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

  • MariaDB 10

Example

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

For example:

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

SELECT CURRENT_DATE() + 0;
Result: 20140518

SELECT CURRENT_DATE() + 1;
Result: 20140519