Mysql Sec_to_time Function
MySQL: SEC_TO_TIME Function
This tutorial explains how to use the MySQL SEC_TO_TIME function with syntax and examples.
Description
The MySQL SEC_TO_TIME function converts numeric seconds into a time value.
Syntax
The syntax for the SEC_TO_TIME function in MySQL is:
Parameters or Arguments
- seconds
A numeric value representing the number of seconds. This value can be positive or negative.
Note
- Time values range from '-838:59:59' to '838:59:59'.
- The SEC_TO_TIME function will format the result as "HH:MM:SS".
- See also the TIME_TO_SEC function.
Applies To
The SEC_TO_TIME function can be used in the following versions of MySQL:
- MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1, MySQL 4.0, MySQL 3.23
Example
Let's look at some MySQL SEC_TO_TIME function examples and explore how to use the SEC_TO_TIME function in MySQL.
For example: