public function __construct(DateTime $lowerLimit, DateTime $upperLimit) { $this->lowerLimit = $lowerLimit; $this->upperLimit = $upperLimit; $this->intervalInSeconds = $upperLimit->getTimestamp() - $lowerLimit->getTimestamp(); }