- var_dump: documentation ( source)
- date: documentation ( source)
<?php
$nowTime = new DateTime;
$programTime = new DateTime(date('Y-m-d') . " 18:30");
$lengthSeconds = 1200;
$endDate = clone $programTime;
$endDate->add(new \DateInterval('PT' . $lengthSeconds . 'S'));
var_dump($endDate->getTimestamp() - $programTime->getTimestamp());