leaf-cq

将秒数转换成时分秒,PHP提供了一个函数gmstrftime,不过该函数仅限于24小时内的秒数转换。对于超过24小时的秒数,我们应该怎么让其显示出来呢,例如25:00:00
$time= 3600*25 ;
function changeTimeType($time){
    if ($time >3600){
       $hours =intval($time/3600);
       $minutes = $time % 3600;
       $times = $hours.":".gmstrftime(\'%M:%S\',$minutes);
   }else{
       $times = gmstrftime(\'%H:%M:%S\',$time);
   }
    return $times;
}
还不会,有大招,关注下方公众号直接提问就可以了哈

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
  • 2022-12-23
  • 2021-12-26
  • 2022-01-18
  • 2022-12-23
  • 2021-09-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-15
  • 2022-12-23
相关资源
相似解决方案