date new DateTime echo date- format Y-m-d 2015-06-24 08 45 27 date- mo

1
2
3
4
$date = new DateTime();
echo $date->format('Y-m-d H:i:s');//2015-06-24 08:45:27
$date->modify('-180 second');
echo $date->format('Y-m-d H:i:s');//2015-06-24 08:42:27