Tools.php
public static function secondsBetweenDates($start, $end, $absolute = true, $timezone = 'Europe/Prague')
    {
        $timezoneObj = new \DateTimeZone($timezone);
        $date = new DateTime($end, $timezoneObj);
        $diff = $date->diff(new DateTime($start, $timezoneObj), $absolute);

        return ($diff->invert ? -1 : 1) * (($diff->days * 86400) + ($diff->h * 3600) + ($diff->i * 60) + $diff->s);
    }
public static function secondsBetweenDates($start, $end, $absolute = true, $timezone = 'Europe/Prague')
    {
        $timezoneObj = new \DateTimeZone($timezone);
        $date = new DateTime($end, $timezoneObj);
        $diff = $date->diff(new DateTime($start, $timezoneObj), $absolute);

        return ($diff->invert ? -1 : 1) * (($diff->days * 86400) + ($diff->h * 3600) + ($diff->i * 60) + $diff->s);
    }
Get difference between two dates in seconds

@param string $start Start date in DateTime compatible syntax
@param string $end End date in DateTime compatible syntax
@param bool $absolute Return absolute (positive) number
@param string $timezone Timezone @see http://php.net/manual/en/timezones.php
@return int Difference in seconds