- date: documentation ( source)
- strtotime: documentation ( source)
<?php
$seg="20";
$horaActual=(new \DateTime())->format('Y-m-d H:i:s');
$horafinal = strtotime ( '-'.$seg.' second' , strtotime ( $horaActual ) ) ;
$horafinal = date ( 'Y-m-d H:i:s' , $horafinal );
echo ($horaActual. PHP_EOL);
echo ($horafinal. PHP_EOL);
//print_r($horafinal);
?>