function dateDistance($first,$second) {
$_start = $first;
$_end = $second;
$_start_time = strtotime($_start);
$_end_time = strtotime($_end);
$_timestamp = $_end_time-$_start_time;
$_days = floor($_timestamp / 86400);
$_hous = floor($_timestamp % 86400 / 3600);
$_mintues = floor($_timestamp % 86400 % 3600 / 60);
$_secode = floor($_timestamp % 86400 % 3600 % 60);
return "相差${_days}天,${_hous}小时,${_mintues}分钟,${_secode}秒";
}
php计算两个时间差
最新推荐文章于 2023-03-13 16:06:05 发布