一个字段是秒  
stime 
120
100
6转换成
00:02:00
00:01:40
00:00:06
小时格式,会到小时的不止会到分钟.求大神教下 这个 怎么写  可用 立马给分,在线等.  

解决方案 »

  1.   

    SEC_TO_TIME(seconds) Returns the seconds argument, converted to hours, minutes, and seconds, as a TIME value. The range of the result is constrained to that of the TIME data type. A warning occurs if the argument corresponds to a value outside that range. mysql> SELECT SEC_TO_TIME(2378);
            -> '00:39:38'
    mysql> SELECT SEC_TO_TIME(2378) + 0;
            -> 3938