totn MariaDB Functions

MariaDB: CURRENT_TIMESTAMP Function

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

Description

The MariaDB CURRENT_TIMESTAMP function returns the current date and time.

Syntax

The syntax for the CURRENT_TIMESTAMP function in MariaDB is:

CURRENT_TIMESTAMP( )

Parameters or Arguments

There are no parameters or arguments for the CURRENT_TIMESTAMP function.

Note

  • The CURRENT_TIMESTAMP function will return the current date as a 'YYYY-MM-DD HH:MM:SS' format, if used in a string context.
  • The CURRENT_TIMESTAMP function will return the current date as a YYYYMMDDHHMMSS format, if used in a numeric context.
  • The CURRENT_TIMESTAMP, LOCALTIME, and LOCALTIMESTAMP functions are synonyms for the NOW function.

Applies To

The CURRENT_TIMESTAMP function can be used in the following versions of MariaDB:

  • MariaDB 10

Example

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

For example:

SELECT CURRENT_TIMESTAMP();
Result: '2014-05-18 10:41:33'

SELECT CURRENT_TIMESTAMP() + 0;
Result: 20140518104133

SELECT CURRENT_TIMESTAMP() + 1;
Result: 20140518104134