PHP开发教程

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)


Powered by PHP二次开发 ©2008-2017