Example
Format a time:
SELECT TIME_FORMAT("19:30:10", "%H %i %s");
Definition and Usage
The TIME_FORMAT() function formats a time by a specified format.
Syntax
TIME_FORMAT(time, format)
Format a time:
SELECT TIME_FORMAT("19:30:10", "%H %i %s");
The TIME_FORMAT() function formats a time by a specified format.
TIME_FORMAT(time, format)
Extract the time part from a time expression:
SELECT TIME("19:30:10");
The TIME() function extracts the time part from a given time/datetime.
Note: This function returns “00:00:00” if expression is not a datetime/time, or NULL if expression is NULL.
TIME(expression)