Skip to main content
Version: V1.0.0

TIME_FORMAT

Declaration

TIME_FORMAT(time,format)

Description

The usage is similar to the DATE_FORMAT function, but the format parameter only supports format specifiers for hours, minutes, seconds, and microseconds.

If the time value time contains hours greater than 23, the %H and %k hour format specifiers generate values greater than 0..23, while other hour format specifiers generate hour values (modulo 12).

Examples

SELECT TIME_FORMAT('100:00:00', '%H %k %h %I %l');
+--------------------------------------------+
| TIME_FORMAT('100:00:00', '%H %k %h %I %l') |
+--------------------------------------------+
| 100 100 04 04 4 |
+--------------------------------------------+
1 row in set (0.001 sec)