SEC_TO_TIME
SEC_TO_TIME(seconds)
Section titled “SEC_TO_TIME(seconds)”- seconds: This is an expression that will be converted into seconds. It must be a positive integer of numeric type measuring the time duration in seconds. The output will be a string formatted as “hh
Example
Section titled “Example”SELECT SEC_TO_TIME(3661);Output
Section titled “Output”'01:01:01'Explanation
Section titled “Explanation”The SEC_TO_TIME function in MySQL converts a number, provided as input, into time format (hours, minutes, and seconds). In the example, the input 3661 seconds is converted to ‘01:01:01’, representing 1 hour, 1 minute, and 1 second.