Name

CURTIME( )

Synopsis

CURTIME( )

This function returns the current system time in hh:mm:ss format. It will return the time in an hhmmss format if it’s used as part of a numeric calculation (see example). This is an alias for CURRENT_TIME( ).

SELECT CURTIME( ) AS Now,
       CURTIME( ) + 10000 AS 'Hour Later';
+----------+------------+
| Now      | Hour Later |
+----------+------------+
| 16:35:43 |     163643 |
+----------+------------+

By adding 10,000 to the current time, this statement increases the hour by 1 and the minutes and seconds by zero each, and displays the time in the second field without dashes.

Get MySQL in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.