How to get timestamp of start to end (current) day period on PHP?

$dtNow = new \DateTime();
$beginOfDay = clone $dtNow;
$beginOfDay->modify('today');

$endOfDay = clone $beginOfDay;
$endOfDay->modify('tomorrow');
$endOfDay->modify('1 second ago');

$start_timestamp = $beginOfDay->getTimestamp();
$end_timestamp = $endOfDay->getTimestamp();

echo 'Start: '.$start_timestamp." [".date("Y-m-d H:i:s",$start_timestamp)."]"."\n";
echo 'End: '.$end_timestamp." [".date("Y-m-d H:i:s",$end_timestamp)."]"."\n";

Also, you can get first and last timestamps of a current month:

$monthFirst = new DateTime('first day of this month');
$monthLast  = new DateTime('last day of this month');
$monthLast->setTime(23, 59, 59);
$start_timestamp = $monthFirst ->getTimestamp();
$end_timestamp = $monthLast->getTimestamp();