I have one problem, I'm trying to do something like this:
if (datetime - system date> 15 minutes) (false)
if (datetime - system date <= 15 minutes) (true)
But I completely lost. I do not know how to do the operation in PHP.
I ask if I can select this datetime from my database and check if this datetime matches between the last 15 minutes of my server, my DB is Mysql.
I hope you got what I meant! Thank!
Finally, I do this thanks to Sammich and others, here I leave a fragment:
$now = time();
$target = strtotime($row[1]);
$diff = $now - $target;
//15 minuts 15*60 = 900
if ($diff <= 900) {
$seconds = $diff;
} else {
$seconds = $diff;
}
Alsho source
share