TIME_TO_SEC
TIME_TO_SEC is an SQL function used to convert a time value into seconds. This function returns the number of seconds passed since midnight as an integer. The returned value ranges from -838:59:59 to 838:59:59.
TIME_TO_SEC(time)
- time: This represents the time value that would be converted into seconds. The time value must be in the format ‘HH
Example
Output
Explanation
This SQL function converts a time value in the format of ‘HH:MM:SS’ into seconds. In this example, it converts ‘22:23:00’ into 80280 seconds.