PHP计算两个时间之间相差的时分秒

$startDateStr = strtotime($startDate);
$endtDateStr = strtotime($endDate);
$total = $endtDateStr-$startDateStr; //首先将两者转换成时间搓并相减
$time = '剩余'.floor($total/86400).'天'.floor(($total%86400)/3600).'小时'.floor(($total%3600)/60).'分钟';       //这里最大是从天数开始的转换

猜你喜欢

转载自blog.csdn.net/linyunping/article/details/79278123
今日推荐