I'm trying to see if the 'last seen' time is within 5 minutes of the current time. If the time is, it gets added to a list. What am I doing wrong here?
Values of variables going into this:
$cell = '2020-10-30 10:39:47'
$current = '2020-10-30 10:41:39'
<?php
...
$current = date('Y-m-d H:i:s');
$datetime_from_last_seen = date("Y-m-d H:i", strtotime("-5 minutes", strtotime($cell)));
$datetime_from_current = date("Y-m-d H:i", strtotime("-5 minutes", strtotime($current)));
$dtflsString = strtotime($datetime_from_last_seen);
$dtfcString = strtotime($datetime_from_current);
if ($dtflsString < $dtfcString)
{
echo "<br>" . "Last Seen: " . $cell . " is within 5 minutes of: " . $current . "<br>";
array_push($my_array_of_times_seen, $cell);
}
...
?>