PHP将秒数转换成时分秒

function changeTimeType($seconds)
{
$seconds = intval($seconds);
if ($seconds > 3600) {
$hours = intval($seconds / 3600);
$time = $hours . ":" . gmstrftime('%M:%S', $seconds);
} else {
$time = gmstrftime('%H:%M:%S', $seconds);
}
return $time;
}

  

posted @ 2022-12-16 16:50  瑾琛  阅读(200)  评论(0编辑  收藏  举报