扫码一下
查看教程更方便
sec_to_time()函数 将秒数转换为“hh:mm:ss”格式
sec_to_time()函数语法如下
sec_to_time(seconds)
返回由指定的参数seconds的值转换的小时、分钟和秒,作为 'hh:mm:ss' 或 hhmmss 格式的值,取决于函数是在字符串还是数字上下文中使用。
mysql> select sec_to_time(2378);
---------------------------------------------------------
| sec_to_time(2378) |
---------------------------------------------------------
| 00:39:38 |
---------------------------------------------------------
1 row in set (0.00 sec)