Skip to content

HOUR_SECOND

SELECT CURTIME() as 'Current Time',
DATE_FORMAT(CURTIME(),'%H:%i:%s') as 'Hour:Minute:Second';
| Current Time | Hour:Minute:Second |
| ------------ | ------------------ |
| 12:34:56 | 12:34:56 |

In this example, the CURTIME() function is used to get the current time. The DATE_FORMAT() function formats the date as hours (H), minutes (i), and seconds (s). The result is a table that displays the default format of CURTIME() and the formatted time.