📜  laravel 刀片时间差 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:53:46.440000             🧑  作者: Mango

代码示例3
$checkTime = strtotime('09:00:59');
echo 'Check Time : '.date('H:i:s', $checkTime);
echo '
'; $loginTime = strtotime('09:01:00'); $diff = $checkTime - $loginTime; echo 'Login Time : '.date('H:i:s', $loginTime).'
'; echo ($diff < 0)? 'Late!' : 'Right time!'; echo '
'; echo 'Time diff in sec: '.abs($diff); echo '
'; $loginTime = strtotime('09:00:59'); $diff = $checkTime - $loginTime; echo 'Login Time : '.date('H:i:s', $loginTime).'
'; echo ($diff < 0)? 'Late!' : 'Right time!'; echo '
'; $loginTime = strtotime('09:00:00'); $diff = $checkTime - $loginTime; echo 'Login Time : '.date('H:i:s', $loginTime).'
'; echo ($diff < 0)? 'Late!' : 'Right time!';