MySQL TIME_FORMAT Function

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)

Continue reading MySQL TIME_FORMAT Function

MySQL TIME Function

Example

Extract the time part from a time expression:

SELECT TIME("19:30:10");

Definition and Usage

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.

Syntax

TIME(expression)

Continue reading MySQL TIME Function