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