MySQL Current_Time or Current_Time() are the Date Function, which are used to return the current time in HH:MM:SS or HHMMSS string format. In this article, we will show you, How to use these Current Time functions in MySQL with example.
MySQL CURRENT_TIME Syntax
The basic syntax of the Current time in MySQL is as shown below:
CURRENT_TIME;
CURRENT_TIME();
TIP: Both these functions are the synonyms of CURTIME(). All these three functions will return the same output.
MySQL CURRENT_TIME Example
The following statements shows you, how to use these MySQL Current time functions.
SELECT CURRENT_TIME;
SELECT CURRENT_TIME();
OUTPUT
As you can see, both the above statements returns the current time in HH:MM:SS format.
Below statements show you, what happens when add few seconds to the MySQL Current_Time function.
SELECT CURRENT_TIME, CURRENT_TIME + 0, CURRENT_TIME + 5;
SELECT CURRENT_TIME(), CURRENT_TIME() + 0, CURRENT_TIME() + 32;
OUTPUT
As you can see from the above, they added those extra seconds to current time, and displaying the current time in HHMMSS string format
Thank You for Visiting Our Blog