+
95
-

回答

<?php
//秒数转时分秒
function secondformat($seconds){
$seconds = intval($seconds);
if ($seconds >3600){
$hours =intval($seconds/3600);
$minutes = $seconds % 3600;
$time = $hours.":".gmstrftime('%M:%S',$minutes);
}else{
$time = gmstrftime('%H:%M:%S',$seconds);
}
return $time;
}
echo secondformat(123123);

网友回复

我知道答案,我要回答