How to get time difference in minutes in PHP
The solution is, we have to subtract the last most one from the future one.
Then we have to divide it by 60.
They’re just a big number showing the number of seconds from January 1, 1970, 00:00:00 GMT, Because times are done in Unix forma
The easiest solution ever,
$to_time = strtotime("2008-12-13 10:42:00");
$from_time = strtotime("2008-12-13 10:21:00");
echo round(abs($to_time - $from_time) / 60,2). " minute";
I think this is a cool and easy way,
$date1 = time();
$date2 = time();
$mins = ($date2 - $date1) / 60;