i need to subtract an hour from a string '2017-04-20 11:46:00' and convert it back to the same format. I have tried below function
<?php
$date = new DateTime('2017-04-20 11:46:00');
$tosub = new DateInterval('PT01H00M');
$result =date_format($tosub,"Y-m-d H:i:s");
echo $result;
?>