Returns the date time object with the given expiration month and year.

@param string $expiryMonth
@param string $expiryYear
@return string
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');
    }
57732
public function getExpiration()
    {
        $dateTime = new DateTime();

        return $dateTime
            ->setDate($this->year, $this->month, $this->getMonthDays())
            ->setTime(23, 59, 59);
    }
1338983
public function expiresIn($tokenAbstract)
    {
        $token = $this->fromAbstract($tokenAbstract);

        if (isset($token->ExpiresAt)) {
            $expiry = \DateTime::createFromFormat(\DateTime::ATOM, $token->ExpiresAt);

            // Check if expiry is a valid datetime
            if ($expiry) {
                $now = new \Datetime;

                // Return time left between now and Expiry time (in seconds)
                $expiresIn = $expiry->getTimestamp() - $now->getTimestamp();

                return ($expiresIn > 0) ? $expiresIn : 0;
            }
        }

        return false;
    }
1153876
public function setAsCache(DateTimeObject $expirationDate)
    {
        $expirationDateFormatted = date('D, d M Y H:i:s', $expirationDate->getTimestamp());

        $this->cacheControl->key('Expires', $expirationDateFormatted . ' GMT');

        $maxAge = $expirationDate->getTimestamp() - time();
        $this->cacheControl->key('Cache-Control', 'private, max-age=' . $maxAge);
        $this->cacheControl->key('Last-Modified', date('D, d M Y H:i:s') . ' GMT');

        return $this;
    }
1030785
public function setExpire($expire)
    {
        if (null !== $expire) {
            $this->expire = (int) $expire;
        } else {
            $this->expire = $expire;
        }

        return $this;
    }
1324631
public static function expiresAt($expiresAt)
    {
        if (false === $dateTime = DateTime::createFromFormat(DateTime::ATOM, $expiresAt)) {
            throw new InputValidationException('invalid "expires_at"');
        }

        return $dateTime;
    }
1208438
public function getTemporaryUrl(DateTimeInterface $expiration, array $options = []): string
    {
        return $this
            ->filesystemManager
            ->disk($this->media->disk)
            ->temporaryUrl($this->getPath(), $expiration, $options);
    }
968808
public function setCardExpiryDate($month, $year)
	{
		$this->validateInputIsInteger(Request::ATTRIBUTE_CARD_EXPIRY_DATE, $month);
		$this->validateInputIsInteger(Request::ATTRIBUTE_CARD_EXPIRY_DATE, $year);
		$this->validateInputIsCardExpiryDate($month, $year);

		$cardExpiryDate = Request::formatDate($month, $year);

		$this->cardExpiryDate = $cardExpiryDate;

		return $this;
	}
1251830
function calcBlindPositionExpiry(expiryperiod) {
    var expiryTimestamp = new Date();
    expiryTimestamp.setMinutes(expiryTimestamp.getMinutes() + expiryperiod);
    return expiryTimestamp;
  }
810425
public function set( $key = '', $value = '', $expiry = '' ) {
		if ( true === $this->is_option ) {
			return $this->set_option( $key, $value, $expiry );
		}
		return $this->set_transient( $key, $value, $expiry );

	}
386477
public function getExpiryDate($binding_index)
    {
        $binding = $this->getBinding();
        return array_key_exists('expiryDate', $binding[$binding_index]) ? $binding[$binding_index]['expiryDate'] : null;
    }
766301
public function setExpire($expire)
	{
		if (null !== $expire)
		{
			$this->expire = $expire instanceof \DateTime ? $expire->getTimestamp() : (int) $expire;
		}
		else
		{
			$this->expire = $expire;
		}

		return $this;
	}
26913
public function getExpireTime($lifetime = null, $bypass_control = false)
    {
        $expire = 0;

        if (null !== $lifetime && 0 !== $lifetime) {
            $now = new \DateTime();

            if (0 < $lifetime) {
                $now->add(new \DateInterval('PT'.$lifetime.'S'));
            } else {
                $now->sub(new \DateInterval('PT'.(-1 * $lifetime).'S'));
            }

            $expire = $now->getTimestamp();
        }

        if (true === $bypass_control) {
            return $expire;
        }

        return $this->getControledExpireTime($expire);
    }
667163
public function setExpire($expire)
    {
        if (!$expire instanceof DateTime) {
            if (is_integer($expire)) {
                $expire = (new DateTime())->setTimestamp($expire);
            } else {
                $expire = new DateTime($expire);
            }
        }
        $this->expire = $expire;

        return $this;
    }
1216223
public function cached($public = true, $expires = '+1 year')
    {
        if (!is_int($expires)) {
            $expires = strtotime($expires);
        }
        $maxAge = $expires - time();
        $pragma = $public ? 'public' : 'private';
        $cache = $pragma . ', max-age=' . $maxAge;
        $response = clone $this;
        $response->setHeader('Expires', Message::date($expires));
        $response->setHeader('Pragma', $pragma);
        $response->setHeader('Cache-Control', $cache);
        return $response;
    }
587928
private function getControledExpireTime($expire)
    {
        $lifetime = $this->getControledLifetime($expire - time());

        if (0 < $lifetime) {
            return time() + $lifetime;
        }

        return $expire;
    }
502132
protected static function expiryTimestamp()
    {
        $handler = eZExpiryHandler::instance();
        if ( $handler->hasTimestamp( self::CACHE_SIGNATURE ) )
        {
            $ret = $handler->timestamp( self::CACHE_SIGNATURE );
        }
        else
        {
            $ret = false;
        }
        return $ret;
    }