标签:new 转换 UNC php ret second 记录 else cti
通讯记录需要用到的一个方法,记录下~
/** * 秒转换为天,小时,分钟 * * @param int $second * * @return string */ function secondConversion($second = 0) { $newtime = ‘‘; $d = floor($second / (3600*24)); $h = floor(($second % (3600*24)) / 3600); $m = floor((($second % (3600*24)) % 3600) / 60); if ($d>‘0‘) { if ($h == ‘0‘ && $m == ‘0‘) { $newtime= $d.‘天‘; } else { $newtime= $d.‘天‘.$h.‘小时‘.$m.‘分‘; } } else { if ($h!=‘0‘) { if ($m == ‘0‘) { $newtime= $h.‘小时‘; } else { $newtime= $h.‘小时‘.$m.‘分‘; } } else { $newtime= $m.‘分‘; } } return $newtime; }
标签:new 转换 UNC php ret second 记录 else cti
原文地址:https://www.cnblogs.com/wangyang0210/p/10789597.html