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.
Syntax :
MAKETIME(hour, minute, second)Parameters : This method accepts three parameters as given below -
- hour : Specified hours value
- minute : Specified minutes value
- second : Specified seconds value
SELECT MAKETIME(9, 3, 12);Output :
09:03:12Example-2 : Getting a time "838:54:59" from specified 838 hours, 54 minutes and 59 seconds.
SELECT MAKETIME(838, 54, 59);Output :
838:54:59Example-3 : 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);Output :
838:59:59Application : This function is used to create and return a time value based on specified hour, minute, and second value.