Get expiration duration.
If `expiredAfterAttribute` is not specified, false will be given.
@return boolean
198962
public function getExpiredAfter()
    {
        if (!is_string($this->expiredAfterAttribute) || empty($this->expiredAfterAttribute)) {
            return false;
        }
        return (int)($this->{$this->expiredAfterAttribute});
    }
643702
private function computeExpiration()
  {
    $delta = self::$timeFactor[$this->getMetric()] * $this->getMetricFactor();
    return $this->getTimeStart() + $delta;
  }
702817
public function expired($onSessionExpires = false)
    {
        if (!$this->_data['expires'] && $onSessionExpires) {
            return true;
        }

        return $this->_data['expires'] < time() && $this->_data['expires'];
    }
378465
public function getExpires()
    {
        list($key, $groupKey) = $this->getKeys(func_get_args());
        $this->engine->setGroupKey($groupKey);

        if (!$this->engine->isValid($key, true)) {
            return null;
        }

        return $this->engine->getExpires($key);
    }
1236341
protected Boolean getIgnoreExpirationDate() {

        Boolean isIgnoreExpirationDate = parseOptionalBooleanValue(m_configObject, JSON_KEY_IGNORE_EXPIRATION_DATE);
        return (null == isIgnoreExpirationDate) && (m_baseConfig != null)
        ? Boolean.valueOf(m_baseConfig.getGeneralConfig().getIgnoreExpirationDate())
        : isIgnoreExpirationDate;
    }
131853
protected function getCookieExpirationDate()
    {
        if (!empty($this->config['expire_on_close'])) {
            $expirationDate = 0;
        } else {
            $expirationDate = Carbon::now()->addMinutes(5 * 60);
        }
        return $expirationDate;
    }
537125
public function isExpired()
    {
        $createdSeconds = strtotime($this->Created);

        $validForSeconds = (int) $this->ValidForDays * 24 * 60 * 60;

        $nowSeconds = DBDatetime::now()->getTimestamp();

        return ($createdSeconds + $validForSeconds) <= $nowSeconds;
    }
924972
public function getIsExpired()
    {
        $createdAt = $this->getCreatedAt();
        if ($this->getExpiredAfter() === false || $createdAt === null) {
            return false;
        }
        if ($this->timeType == static::$timeTypeLocal) {
            return $this->getDatetimeOffset($this->offsetDatetime($this->currentDatetime(), -$this->getExpiredAfter()), $createdAt) > 0;
        } elseif ($this->timeType == static::$timeTypeUtc) {
            return $this->getDatetimeOffset($this->offsetDatetime($this->currentUtcDatetime(), -$this->getExpiredAfter()), $createdAt) > 0;
        }
        return false;
    }
685828
public function getExpiry($key)
    {
        $key = $this->getPrefix().$key;
        if (!$this->isInCache($key)) {
            return false;
        }

        return $this->fetchExpirationFromCache($key);
    }
947286
function isExpired()
	{
        eZDebug::writeDebug( 'Check expiration', __METHOD__ );

        // If passwordlifetime is not defined or 0 (zero, infinite lifetime) passwords never expire.
        if ( ( $this->attribute( 'passwordlifetime' ) == self::NOT_DEFINED ) ||
             ( $this->attribute( 'passwordlifetime' ) == 0 ) )
            return false;

        $passwordLastUpdated = $this->attribute( 'password_last_updated' );
        $actualPasswordlifetime = ceil( ( ( ( ( time() - $passwordLastUpdated ) / 60 ) / 60 ) / 24 ) );

        eZDebug::writeDebug( $passwordLastUpdated, __METHOD__ );
        eZDebug::writeDebug( $actualPasswordlifetime, __METHOD__ );

        if ( ( $actualPasswordlifetime > $this->attribute( 'passwordlifetime' ) ) ||
               $passwordLastUpdated == 0 ||
               $passwordLastUpdated == self::NOT_DEFINED )
        {
            return true;
        }

		return false;
	}
168509
private function getExpirationDate($expiryMonth, $expiryYear) {
        $expDate = new DateTime(
            $expiryYear
            . '-'
            . $expiryMonth
            . '-'
            . '01'
            . ' '
            . '00:00:00',
            new DateTimeZone('UTC')
        );

        return $expDate->add(new DateInterval('P1M'))->format('Y-m-d 00:00:00');
    }
713420
public function getTTL()
    {
        if (is_null($this->expiration)) {
            return null;
        }
        if ($this->expiration > $_SERVER['REQUEST_TIME']) {
            return $this->expiration - $_SERVER['REQUEST_TIME'];
        }
        return 0;
    }
1001669
function getTtl(): ?int
    {
        if (is_int($this->expiration)) {
            return $this->expiration;
        }

        if ($this->expiration instanceof \DateTimeInterface) {
            return $this->expiration->getTimestamp() - Clock::time();
        }

        if ($this->expiration instanceof \DateInterval) {
            return PsrCacheHelper::convertDateIntervalToTtl($this->expiration);
        }

        return null;
    }
328207
public com.google.protobuf.Duration getExpiration() {
    return expiration_ == null ? com.google.protobuf.Duration.getDefaultInstance() : expiration_;
  }
136838
public function expirationDate()
    {
        $accountExpiry = $this->getAccountExpiry();

        // If the account expiry is zero or the expiry is equal to
        // ActiveDirectory's 'never expire' value,
        // then we'll return null here.
        if ($accountExpiry == 0 || $accountExpiry == $this->getSchema()->neverExpiresDate()) {
            return;
        }

        $unixTime = Utilities::convertWindowsTimeToUnixTime($accountExpiry);

        return (new DateTime())->setTimestamp($unixTime);
    }
1101824
public function passwordExpired()
    {
        // First we'll check the users userAccountControl to see if
        // it contains the 'password does not expire' flag.
        if ($this->getUserAccountControlObject()->has(AccountControl::DONT_EXPIRE_PASSWORD)) {
            return false;
        }

        $lastSet = (int) $this->getPasswordLastSet();

        if ($lastSet === 0) {
            // If the users last set time is zero, the password has
            // been manually expired by an administrator.
            return true;
        }

        // We'll check if we're using the ActiveDirectory schema to retrieve
        // the max password age, as this is an AD-only feature.
        if ($this->schema instanceof ActiveDirectory) {
            $query = $this->query->newInstance();

            // We need to get the root domain object to be able to
            // retrieve the max password age on the domain.
            $rootDomainObject = $query->select($this->schema->maxPasswordAge())
                ->whereHas($this->schema->objectClass())
                ->first();

            $maxPasswordAge = $rootDomainObject->getMaxPasswordAge();

            if (empty($maxPasswordAge)) {
                // There is not a max password age set on the LDAP server.
                return false;
            }

            // convert from 100 nanosecond ticks to seconds
            $maxPasswordAgeSeconds = $maxPasswordAge / 10000000;

            $lastSetUnixEpoch = Utilities::convertWindowsTimeToUnixTime($lastSet);
            $passwordExpiryTime = $lastSetUnixEpoch - $maxPasswordAgeSeconds;

            $expiresAt = (new DateTime())->setTimestamp($passwordExpiryTime);

            // If our current time is greater than the users password
            // expiry time, the users password has expired.
            return (new DateTime())->getTimestamp() >= $expiresAt->getTimestamp();
        }

        return false;
    }
882365
public function isExpired()
    {
        if (isset($this->_claims['exp']) && is_numeric($this->_claims['exp']))
        {
            $now  = new DateTime('now');
            return ($now->format('U') - $this->_claims['exp']) > 0;
        }

        return false;
    }