MySQL CURRENT_TIMESTAMP

MySQL CURRENT_TIMESTAMP or CURRENT_TIMESTAMP() are the two Date Functions, which are 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 an example. The basic syntax of the CURRENT TIMESTAMP is as shown below:

CURRENT_TIMESTAMP;

CURRENT_TIMESTAMP();

MySQL CURRENT_TIMESTAMP Example

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

SELECT CURRENT_TIMESTAMP();

SELECT CURRENT_TIMESTAMP;

SELECT NOW();
Example 1

From the above screenshot, you can see that 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;

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

CURRENT_TIMESTAMP 2