I want to send a reminder email.I don't want to use cron
on Linux/Unix/BSD box or Scheduled Tasks on Windows.
I'm trying to subtract 15 minutes from the current time.
here is my code so far (doesn't work):
$days = date("j",time()); $months = date("n",time()); $years = date("Y",time()); $hours = date("G",time()); $mins = (date("i",time())); $secs = date("s",time()); $mins = $mins-15;
To subtract time, type in =B2-B1, and it'll return the elapsed time. The answer is displayed as an AM time, so to change that, right click and select Format Cells and change it to h:mm. It'll return the answer in time format (7:35, or 7 hours and 35 minutes).
Calculate the duration between two times The goal is to subtract the starting time from the ending time under the correct conditions. If the times are not already in 24-hour time, convert them to 24-hour time. AM hours are the same in both 12-hour and 24-hour time.
To subtract 15 minutes from the current time, you can use strtotime()
:
$newTime = strtotime('-15 minutes'); echo date('Y-m-d H:i:s', $newTime);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With