public function getLength() { $begin = $this->begin->toDateTime(); $end = $this->end->toDateTime(); $diff = $begin->diff($end); return new Duration($diff->format('%H'), TimeUnit::hour()); }