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 (numeric format) if it’s used as part of a numeric calculation. This is an alias for CURRENT_TIME(). Here is an example:

SELECT CURTIME() AS Now,
CURTIME() + 10000 AS 'Hour Later';
r';

+----------+------------+
| Now      | Hour Later |
+----------+------------+
| 16:35:43 |     163543 |
+----------+------------+

By adding 10,000 to the current time, this statement increases the hour by 1 and the minutes and seconds by 0 each. This is in keeping with the yyyymmddhhmmss format previously mentioned.

Get MySQL in a Nutshell, 2nd Edition 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.