MySQL 8.4
MAKETIME(hour, minute, second)- hour
- Hours, can exceed 23 and be negativeINT
- minute
- Minutes from 0 to 59INT
- second
- Seconds from 0 to 59, can be fractionalDECIMAL
Return value
A time (TIME) from -838:59:59 to 838:59:59, hours can exceed 23; NULL if minutes or seconds are outside the range from 0 to 59
Examples
Time from hours, minutes and seconds
MySQL 8.4
SELECT MAKETIME(12, 30, 45);Over a day with fractional seconds
MySQL 8.4
SELECT MAKETIME(100, 30, 45.5);Minutes out of range
MySQL 8.4
SELECT MAKETIME(12, 60, 0);Details
The result is a TIME value, and this type has a limit: hours above 838 are clipped, MAKETIME(900, 0, 0) returns 838:59:59 with a warning.