Consider the following,
$date = new DateTime(null, new DateTimeZone('Asia/Kolkata'));
$sysdate = date_format($date, 'H:i:s');
echo $sysdate;
Result: 17:31:48
Let me know how to minus 5 minutes from sysdate.
In objective style, you can use method sub and DateInterval object:
$date = new DateTime(null, new DateTimeZone('Asia/Kolkata'));
echo $date->format('H:i:s').PHP_EOL;
$date->sub(new DateInterval('PT5M'));
echo $date->format('H:i:s').PHP_EOL;
result:
17:44:04
17:39:04
Try this! hope this may help...
$date = new DateTime(null, new DateTimeZone('Asia/Kolkata'));
$sysdate = date_format(strtotime($date), 'H:i:s');
echo date('H:i:s',time($sysdate) - 05*60);
Not tested, but this might help..$date->sub(new DateInterval('PT0H5M'));
Link::
http://www.php.net/manual/en/datetime.sub.php