秒转成时间格式(ts)

/**
 *
 * @author rusheng 2016/04/24
 *
 */
class UStringUtils 
{
public static timeFormat(s):string
{
        var hours  = Math.round(s/3600) ;
        var minutes = Math.round(s/60) %60  ;
        var seconds  = s%60 ;
        return (hours < 10 ? "0" + hours : hours) + ":" + (minutes < 10 ? "0" + minutes : minutes) + ":" + (seconds < 10 ? "0" + seconds : seconds)
}
}

你可能感兴趣的:(秒转成时间格式(ts))