无涯教程-MySQL - sec_to_time() 函数

90 阅读1分钟

sec_to_time()是MySQL日期/时间函数。它用于将给定的秒转换为时间。

语法

select sec_to_time(second);

参数

second:获取时间的第二个值。

例子1

select sec_to_time(2000);

输出

MySQL Datetime sec_to_time() Function

例子2

select sec_to_time(40);

输出

MySQL Datetime sec_to_time() Function

参考链接

www.learnfk.com/mysql/mysql…