/**
 * Description:将秒数转换为00:00:00(时分秒格式)
 * Param:参数说明
 * [in] $times int n秒
 * Return:返回值
 * 00:00:00(时分秒)
*/
function time_conversion($times){
     $result = '00:00';
          if ($times>0){
              $hour = floor($times/3600);
              $minute = floor($times%3600/60);
              $second = floor(($times-60 * $minute) % 60);
              if ($hour < 10) {
                  $hour = '0' . $hour;
              }
              if($minute<10){
                  $minute = "0".$minute;
              }
              if($second<10){
                  $second = "0".$second;
              }
              $result = $hour.':'.$minute.':'.$second;
          }
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2021-12-18
猜你喜欢
  • 2021-12-25
  • 2022-01-03
  • 2021-12-12
  • 2021-08-04
  • 2021-11-03
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案