MySQL sec_to_time()函數
SEC_TO_TIME(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)