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 t
//To Get Current DateTime
$currentDate = date("Y-m-d H:i:s");
//To Get Current DateTime - 15Min
$oldDate = date("Y-m-d H:i:s", strtotime($currentDate) - (15 * 60));
echo $currentDate;
echo $oldDate;
You can also use DateInterval object
<?php
    $date = new DateTime('Y-m-d H:i:s');
    $date->sub(new DateInterval('PT10H30S'));
    echo $date->format('Y-m-d H:i:s');?>
You can use DateInterval
$date = new DateTime();
$interval = new DateInterval("PT15M");
$interval->invert = 1;
$date->add($interval);
echo $date->format("c") . "\n";
Following is the way you can add days / hours / minutes / sec to current time
  $addInterval = date('Y-m-d H:i:s', strtotime("+$days days $hours hours $minute minute $sec second", strtotime(currentTime)));
echo date('Y-m-d H:i:s', strtotime('-15 minutes'));
you can try this as well,
$dateTimeMinutesAgo = new DateTime("15 minutes ago");
$dateTimeMinutesAgo = $dateTimeMinutesAgo->format("Y-m-d H:i:s");