i am developing a module in php where i am supposed to manage time differences and proceed at a specific time difference. i am fetching a value from database ($end_date) which contains time.
$end_date = $result['end_date'];
getting the server time from
$date = $this->GetServerTime();
getting the time difference between these two
$diffrence = date("Y-m-d H:i:s",strtotime("$date - $end_date"));
now, i need to check IF the time difference is less than 15 seconds via if statement. my approach:
$to_time = strtotime("0000-00-00 00:00:15");
if ($difference < $to_time)
{
echo "here";
}
but i believe i am not doing something right, how else should i compare this? i've done a lot of research but to no avail, any help is appreciated.