CURRENT_TIME() FUNCTION in MySQL

CURRENT_TIME() FUNCTION
The MySQL CURRENT_TIME function is used to get the current time. The various versions of MySQL support the CURRENT_TIME function, namely, MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0 and MySQL 3.23.

Syntax:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
CURRENT_TIME( )
CURRENT_TIME( )
CURRENT_TIME( )

Example 1:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
mysql> SELECT CURRENT_TIME();
mysql> SELECT CURRENT_TIME();
mysql> SELECT CURRENT_TIME();

Output:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
'15:30:20'
'15:30:20'
'15:30:20'

Explanation:
The current time has been returned as a result.

Example 2:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
mysql> SELECT CURRENT_TIME() + 2;
mysql> SELECT CURRENT_TIME() + 2;
mysql> SELECT CURRENT_TIME() + 2;

Output:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
153022.000000
153022.000000
153022.000000

Explanation:
The time value which is 2 seconds after the current time has been returned as the result.