- var_dump: documentation ( source)
<?php
$dateTimeBeforeStr = "2024/09/01 00:00:00";
$dateTimeBefore = new DateTimeImmutable($dateTimeBeforeStr);
$dateTimeAfter = $dateTimeBefore->modify("-1 second");
$dateTimeAfterStr = $dateTimeAfter->format('Y-m-d H:i:s');
var_dump($dateTimeBeforeStr);
var_dump($dateTimeBefore);
var_dump($dateTimeAfter);
var_dump($dateTimeAfterStr);