I need to be able to check if a time is within 15 minutes of specified time over days.
But my issue is that it is only comparing minute and not days or years or months.
EDIT: I have updated my code but it still does not work with previous days.
$notification_time = strtotime("-1 hour", $cal_time);
$really_now = time();
if($really_now >= strtotime("-15 minutes", $notification_time) && $really_now <= strtotime("+15 minutes", $notification_time))
{ echo 'within time!'; }
The above code works if $really_now is within 30 minutes of -1 hour of $cal_time. But when I try:
$notification_time = strtotime("-1 day", $cal_time);
If the current time is within 30 minutes of $cal_time -1 day it will not work.