MAKETIME() function :
This function in MySQL is used to create and return a time value based on specified hour, minute, and second value. In MySQL’s TIME value limit is 838:59:59.
MAKETIME(hour, minute, second)
This method accepts three parameters as given below –
- hour : Specified hours value
- minute : Specified minutes value
- second : Specified seconds value
It returns a time value based on a specified hour, minute, and second value.
Getting a time “09:03:12” from specified 9 hours, 3 minutes and 12 seconds.
SELECT MAKETIME(9, 3, 12);
Getting a time “838:54:59” from specified 838 hours, 54 minutes and 59 seconds.
SELECT MAKETIME(838, 54, 59);
Getting a time “838:59:59” from specified 839 hours, 12 minutes, and 9 seconds. Here hours are taken as 839 which is greater than the hour limit of 838, so returned time is up to its limit of “838:59:59”.
SELECT MAKETIME(839, 12, 9);
This function is used to create and return a time value based on specified hour, minute, and second value.