laravel difference between current time and created time
#1 -> 10 minutes after
$lifeSpan = $now->diffForHumans($token->created_at);
#2 -> "00:10:30 Minutes"
$lifeSpan = $now->diff($token->updated_at)->format('%H:%I:%S')." Minutes";
laravel difference between current time and created time
#1 -> 10 minutes after
$lifeSpan = $now->diffForHumans($token->created_at);
#2 -> "00:10:30 Minutes"
$lifeSpan = $now->diff($token->updated_at)->format('%H:%I:%S')." Minutes";
difference in minutes between 2 time inputs laravel
$checkTime = strtotime('09:00:59');
echo 'Check Time : '.date('H:i:s', $checkTime);
echo '<hr>';
$loginTime = strtotime('09:01:00');
$diff = $checkTime - $loginTime;
echo 'Login Time : '.date('H:i:s', $loginTime).'<br>';
echo ($diff < 0)? 'Late!' : 'Right time!'; echo '<br>';
echo 'Time diff in sec: '.abs($diff);
echo '<hr>';
$loginTime = strtotime('09:00:59');
$diff = $checkTime - $loginTime;
echo 'Login Time : '.date('H:i:s', $loginTime).'<br>';
echo ($diff < 0)? 'Late!' : 'Right time!';
echo '<hr>';
$loginTime = strtotime('09:00:00');
$diff = $checkTime - $loginTime;
echo 'Login Time : '.date('H:i:s', $loginTime).'<br>';
echo ($diff < 0)? 'Late!' : 'Right time!';
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us