/**
* @param $time
* @return bool|string
* 将秒数转换为时间(年、天、小时、分、秒)
*/
function Sec2Time($times){
$result = '00:00:00';
if ($times>0) {
$hour = floor($times/3600);
$minute = floor(($times-3600 * $hour)/60);
$second = floor((($times-3600 * $hour) - 60 * $minute) % 60);
$result = sprintf ( "%02d",$hour).':'.sprintf ( "%02d",$minute).':'.sprintf ( "%02d",$second);
}
return $result;
}
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END