Returns the expiration timestamp.

@param int $lifetime

@return int
@codeCoverageIgnore
964031
public function getExpireTime($lifetime = null, $bypass_control = false)
    {
        $expire = parent::getExpireTime($lifetime, $bypass_control);

        return (0 === $expire) ? null : date_timestamp_set(new \DateTime(), $expire);
    }
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;
	}
620
public function getPreviousVersion($from)
    {
        $lastTimestamp = 0;
        foreach (array_keys($this->versions) as $timestamp) {
            if ($timestamp == $from) {
                return $lastTimestamp;
            }
            $lastTimestamp = $timestamp;
        }

        return 0;
    }
557715
protected function getCookieExpirationDate()
    {
        $config = $this->manager->getSessionConfig();

        return $config['expire_on_close'] ? 0 : Carbon::now()->addMinutes($config['lifetime']);
    }
1091817
public static function getLastRunTime()
    {
        $timestamp = Option::get(self::LAST_RUN_TIME_OPTION_NAME);
        return $timestamp === false ? false : Date::factory((int)$timestamp);
    }
1186261
protected function resolveCacheLifetime($lifetime): DateTime
    {
        if ($lifetime instanceof DateTime) {
            return $lifetime;
        }

        if (is_int($lifetime)) {
            return Carbon::now()->addMinutes($lifetime);
        }
    }
928021
protected static function getExpire(int $filemtime, int $expire): int {
		if ($expire === -1)
			return -1;
		$time = $filemtime + $expire - time();
		return ($time > 0) ? $time : 0;
	}
1347846
protected function store_check_expiration($expiration=null) {
		if (!$expiration)
			return 3600 * 2;
		$expiration = (int)$expiration;
		if ($expiration < 600)
			$expiration = 600;
		return $expiration;
	}
583412
function timestamp( $name )
    {
        if ( !isset( $this->Timestamps[$name] ) )
        {
            eZDebug::writeError( "Unknown expiry timestamp called '$name'", __METHOD__ );
            return false;
        }
        return $this->Timestamps[$name];
    }
269680
public function get(int $lifetime = null, bool $returnObj = false)
    {
        $lifetime = $lifetime ?? 300;
        $key = $this->checksum();

        // try to get image from cache
        $cachedImageData = $this->cache->get($key);

        // if imagedata exists in cache
        if ($cachedImageData) {
            // transform into image-object
            if ($returnObj) {
                $image = $this->manager->make($cachedImageData);
                $cachedImage = new CachedImage;

                return $cachedImage->setFromOriginal($image, $key);
            }

            // return raw data
            return $cachedImageData;
        }

        // process image data
        $image = $this->process();

        // encode image data only if image is not encoded yet
        $encoded = $image->encoded ?: (string) $image->encode();

        // save to cache...
        $this->cache->set($key, $encoded, $lifetime);

        // return processed image
        return $returnObj ? $image : $encoded;
    }
682748
public static function getLifetime()
    {
        Base::checkOpen();
        if (Base::driver() == 'file') {
            return intval(ini_get('session.cookie_lifetime'));
        }
        return Base::getSessionObject()->getLifetime();
    }
412192
protected function calculateExpiryTime(int $lifetime = null): \DateTime
    {
        if ($lifetime === self::UNLIMITED_LIFETIME || ($lifetime === null && $this->defaultLifetime === self::UNLIMITED_LIFETIME)) {
            return new \DateTime(self::DATETIME_EXPIRYTIME_UNLIMITED, new \DateTimeZone('UTC'));
        }

        if ($lifetime === null) {
            $lifetime = $this->defaultLifetime;
        }
        return new \DateTime('now +' . $lifetime . ' seconds', new \DateTimeZone('UTC'));
    }
687125
public function expires($key)
    {
        if (!isset($this->records[$key])) {
            return 0;
        }

        return (int) max(0, $this->records[$key]['expire'] - time());
    }
199579
private function getExpiration($ttl) : int
    {
        if ($ttl === null) {
            return PHP_INT_MAX;
        }

        if (is_int($ttl)) {
            return time() + $ttl;
        }

        return (new DateTime())->add($ttl)->getTimestamp();
    }
568879
public function isExpired()
    {
        $curTime = $this->timer['now'];
        $maxTime = $this->timer['last'] + $this->_lifetime;

        return ($maxTime < $curTime);
    }
620303
protected function getExpiryTime( $id )
    {
        $storedTimeStamp = $this->expiryHandler->hasTimestamp( $id ) ? $this->expiryHandler->timestamp( $id ) : false;
        $expiryTime = $storedTimeStamp !== false ? $storedTimeStamp : 0;

        return $expiryTime;
    }
192862
private function getExpireTime(array $expires = ['m' => 1]): int
    {
        $expireTime = \time();
        if (\is_array($expires)) {
            if (isset($expires['y'])) {
                $expireTime += \intval(0 + $expires['y']) * 60 * 60 * 24 * 365;
            }
            if (isset($expires['m'])) {
                $expireTime += \intval(0 + $expires['m']) * 60 * 60 * 24 * 30;
            }
            if (isset($expires['d'])) {
                $expireTime += \intval(0 + $expires['d']) * 60 * 60 * 24;
            }
            if (isset($expires['h'])) {
                $expireTime += \intval(0 + $expires['h']) * 60 * 60;
            }
            if (isset($expires['i'])) {
                $expireTime += \intval(0 + $expires['i']) * 60;
            }
            if (isset($expires['s'])) {
                $expireTime += \intval(0 + $expires['s']);
            }
        }
        return $expireTime;
    }