totn MariaDB Functions

MariaDB: LOCALTIMESTAMP Function

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

Description

The MariaDB LOCALTIMESTAMP function returns the current date and time.

Syntax

The syntax for the LOCALTIMESTAMP function in MariaDB is:

LOCALTIMESTAMP( )

Parameters or Arguments

There are no parameters or arguments for the LOCALTIMESTAMP function.

Note

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

Applies To

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

  • MariaDB 10

Example

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

For example:

SELECT LOCALTIMESTAMP();
Result: '2014-05-18 10:52:35'

SELECT LOCALTIMESTAMP() + 0;
Result: 20140518105235

SELECT LOCALTIMESTAMP() + 1;
Result: 20140518105236