在我看来,这应该回显11个小时,但返回12个小时;我想念什么?
$start_time = "06:00";
$end_time = "17:00";
$LOD = date("H:i", ((strtotime($end_time) - strtotime($start_time))));
echo "Length of day: " . $LOD . " hours";
更新:在MAMP环境中的我的MBPro上运行;系统时间设置为24小时。
使用date
这种方式没有任何意义。
如果您需要最低限度的知识,则应将其strtotime("00:00")
作为初始时间。
(end - start) + init
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句