php 时间差计算

明天02:56与今天22:45相差多少小时,多少分钟

echo $time = strtotime("+ 1day", strtotime('02:56')) - strtotime('22:45');
echo "\r\n";
echo floor($time / 3600).':'.($time % 3600 / 60);
posted @ 2021-08-19 11:44  蓝晓焰  阅读(68)  评论(0编辑  收藏  举报