PHP函数

1、gmdate

$seconds = 174940;
$hours = intval($seconds/);
$time1 = $hours."小时".gmdate('i分钟s秒', $seconds);
echo $time1;

2、gmstrftime

$seconds = ;
$hours = intval($seconds/);
$time1 = $hours.":".gmstrftime('%M:%S', $seconds);
echo $time1;

封装函数

$seconds = 174940;
$hour = floor($seconds/3600);
$minute = floor(($seconds-3600 * $hour)/60);
$second = floor((($seconds-3600 * $hour) - 60 * $minute) % 60);
$result = $hour.'小时'.$minute.'分钟'.$second.'秒';
echo $result;
05-21 19:50