MySQL CURRENT_TIMESTAMP

MySQL CURRENT_TIMESTAMP or CURRENT_TIMESTAMP() are the two Date Functions, which used to return the current date & time in YYYY-MM-DD HH:MM:SS.

In this section, we show you how to use this CURRENT_TIMESTAMP() function to get local Date & Time with example. The basic syntax of the CURRENT TIMESTAMP in MySQL is as shown below:

CURRENT_TIMESTAMP;

CURRENT_TIMESTAMP();

MySQL CURRENT_TIMESTAMP Example

The following Date Functions statements show you how to use these CURRENT_TIMESTAMP functions. Both the CURRENT_TIMESTAMP and CURRENT_TIMESTAMP() functions are synonyms of NOW() function. All of them return the same MySQL output

SELECT CURRENT_TIMESTAMP();

SELECT CURRENT_TIMESTAMP;

SELECT NOW();
MySQL CURRENT_TIMESTAMP 1

From the above screenshot, you can see, all the statements return the local date and time stamp in YYYY-MM-DD HH:MM:SS format.

The below statements show what happens when adding a few seconds or random value to the CURRENT_TIMESTAMP() function.

SELECT CURRENT_TIMESTAMP() + 0, CURRENT_TIMESTAMP + 0;

SELECT CURRENT_TIMESTAMP() + 10, CURRENT_TIMESTAMP + 10;

SELECT CURRENT_TIMESTAMP() + 10, NOW() + 10;
MySQL CURRENT_TIMESTAMP 2

As you can see, it added those extra seconds and displaying the date in YYYYMMDDHHMMSS string format.