MySQL CURRENT_TIMESTAMP

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

This section shows you how to use this MySQL 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();
MySQL CURRENT_TIMESTAMP() Example 1

The above screenshot shows 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 a 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.

MySQL CURRENT_TIMESTAMP 2