Retorna o tempo de permanência do cliente na unidade.
A diferença entre a data de chegada até a data de fim de atendimento.

@return DateInterval
500102
public function getTempoPermanencia()
    {
        if ($this->tempoPermanencia) {
            return $this->secondsToDateInterval($this->tempoPermanencia);
        }
        
        $interval = new DateInterval('P0M');
        if ($this->getDataFim()) {
            $interval = $this->getDataFim()->diff($this->getDataChegada());
        }

        return $interval;
    }
862439
public function getDatePeriod()
    {
        return new \DatePeriod($this->begin, $this->begin->diff($this->end), $this->end);
    }
969828
private function getSeconds(DateInterval $interval)
    {
        $date = new \DateTimeImmutable('now', new \DateTimeZone('UTC'));
        $date2 = $date->add($interval);
        return $date2->getTimestamp() - $date->getTimestamp();
    }
650629
public function getPrevious()
    {
        $start = clone $this->begin;
        $start->sub(static::getDateInterval());

        return new static($start, $this->factory);
    }
105573
public function diff($time) : DateInterval
    {
        $tmp = new self($time);

        return new DateInterval(abs($this->time - $tmp->getUnixTstamp()));
    }
178757
public function getTimeLeft()
    {
        $iTimeout = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iPsBasketReservationTimeout');
        if ($iTimeout > 0) {
            $oRev = $this->getReservations();
            if ($oRev && $oRev->getId()) {
                $iTimeout -= (\OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime() - (int) $oRev->oxuserbaskets__oxupdate->value);
                \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("iBasketReservationTimeout", $oRev->oxuserbaskets__oxupdate->value);
            } elseif (($iSessionTimeout = \OxidEsales\Eshop\Core\Registry::getSession()->getVariable("iBasketReservationTimeout"))) {
                $iTimeout -= (\OxidEsales\Eshop\Core\Registry::getUtilsDate()->getTime() - (int) $iSessionTimeout);
            }

            return $iTimeout < 0 ? 0 : $iTimeout;
        }

        return 0;
    }
477049
public function getDateIntervalPropertyByUnit(DateInterval $diff, $unit)
    {
        if ($unit === 'seconds') {
            return $diff->s + $diff->i * 60 + $diff->h * 60 * 60 + $diff->days * 60 * 60 * 24;
        }

        if ($unit === 'minutes') {
            return $diff->i + $diff->h * 60 + $diff->days * 60 * 24;
        }

        if ($unit === 'hours') {
            return $diff->h + $diff->days * 24;
        }

        if ($unit === 'days') {
            return $diff->days;
        }

        if ($unit === 'months') {
            return $diff->m + $diff->y * 12;
        }

        if ($unit === 'years') {
            return $diff->y;
        }
    }
891166
public function getDateUpdated() : DateTime
     {
        $rtn = $this->data['date_updated'];

        if (!empty($rtn)) {
            $rtn = new DateTime($rtn);
        }

        return $rtn;
     }
53710
public function getDate() : ?int 
    {
        if ( ! $this->hasDate()) {
            $this->setDate($this->getDefaultDate());
        }
        return $this->date;
    }
1266585
public function getLockoutDate()
    {
        if ($timestamp = $this->getLockoutTimestamp()) {
            return (new DateTime())->setTimestamp($timestamp)->format($this->dateFormat);
        }
    }
454715
function getDateTimeExpiration()
    {
        if (! $this->datetimeExpiration ) {
            if ($this->expiresIn) {
                // Maybe not include this field
                $exprDateTime = __( new \DateTime() )
                    ->add( new \DateInterval(sprintf('PT%sS', $this->expiresIn)) );

                $this->datetimeExpiration = $exprDateTime;
            }

        }


        return $this->datetimeExpiration;
    }
206410
public function lastHeartbeatCheck()
    {
        $check = Cache::get($this->HEARTBEAT_CRON_KEY);
        if (empty($check)) {
            return 'never';
        }

        return date(Library\Utils\Constants::COMMON_DATETIME.' T', $check->time);
    }
1289320
public function getStartDate()
    {
        if (isset($this->_gemsData['gec_startdate']) && $this->_gemsData['gec_startdate']) {
            if (! $this->_gemsData['gec_startdate'] instanceof \MUtil_Date) {
                $this->_gemsData['gec_startdate'] =
                        new \MUtil_Date($this->_gemsData['gec_startdate'], \Gems_Tracker::DB_DATE_FORMAT);
            }
            return $this->_gemsData['gec_startdate'];
        }
    }
187700
public function getTotalSeconds()
	{
		// Use the days value if it is available otherwise the months value will be used which gives
		// nonsense results when the duration has been created from a day interval because the
		// DateInterval assumes 30 days to every month!
		// BMS 2018-03-20 Changed to look at the 'daysOnly' property and use the 'd' value if it is.
		//				  On this date the parent::getTotalSeconds() function returns a value that is out by an hour
		//				  when returning the interval of this expression:
		//				  (xs:dateTime("1999-10-23T09:08:07Z") - xs:dateTime("1998-09-09T04:03:02Z"))
		//				  which appears in test 'op-subtract-dateTimes-yielding-DTD-19' in 'dateTimesSubtract.xml'
		//				  This interval is 408 days 22 hours 58 minutes and 59 seconds

		if ( ! $this->Value->days && ( $this->Value->y || $this->Value->m ) ) return parent::getTotalSeconds();
		// if ( ! $this->Value->days && ! $this->Value->daysOnly ) return parent::getTotalSeconds();

		$seconds = new DecimalValue( ( $this->Value->days ? $this->Value->days : $this->Value->d ) * 86400 + $this->Value->h * 3600 + $this->Value->i * 60 + $this->Value->s );
		$seconds = $seconds->Add( "0.{$this->Value->microseconds}" );
		if ( $this->Value->invert )
		{
			$seconds = $seconds->Mul( -1 );
		}

		return $seconds;
	}
409762
private function fullDiff() : DateInterval
    {
        if (null === $this->fullDiff) {
            $this->fullDiff = $this->from->diff($this->until);
        }
        
        return $this->fullDiff;
    }
624982
public function getExpiresInterval()
    {
        if (!$this->expiresAt) return '';
        $now = new \DateTime();
        $interval = $now->diff($this->expiresAt);
        if ($interval->days == 1)
            return $interval->format('%a jour');
        elseif ($interval->days > 1)
            return $interval->format('%a jours');
        elseif ($interval->h == 1)
            return $interval->format('%h heure');
        else
            return $interval->format('%h heures');
    }
426979
public function getLastAccessedAt() {
		$timestamp = fileatime($this->pathname);
		$time = new DateTime();
		$time->setTimestamp($timestamp);
		return $time;
	}