- var_dump: documentation ( source)
<?php
$now = new DateTime();
$ts = (int)$now->format('U');
$midnight = $ts - $ts % 86400;
$md = DateTime::createFromFormat('U', $midnight);
var_dump($now, $ts, $midnight, $md);
echo "\n\n";
$now_utc = (clone $now)->setTimezone(new DateTimeZone('UTC'));
$new_midnight = (clone $now_utc)->modify('midnight');
$nmt = $new_midnight->format('U');
var_dump($now_utc, $new_midnight, $nmt);