Retrieve the time component from a given time expression.
SELECT TIME(“19:30:10”); |
The TIME() function extracts the time portion from a provided datetime expression.
Note: If the expression is not a datetime or time, it returns “00:00:00”, or NULL if the expression itself is NULL.
TIME(expression) |
Parameter |
Description |
datetime |
Required: The time or datetime from which to extract the time component |
Works in: |
From MySQL version 4.0 |
Retrieve the time component from the datetime expression.
SELECT TIME(“2017-08-15 19:30:10”); |
Extract the time portion from the given datetime expression.
SELECT TIME(“2017-08-15 19:30:10.000001”); |
When applied to NULL, extracting the time part does not yield a valid result.
SELECT TIME(NULL); |