Set the expires value.

@param expires the expires value to set
@return the Attributes object itself.
338221
public Attributes withExpires(DateTime expires) {
        if (expires == null) {
            this.expires = null;
        } else {
            this.expires = expires.toDateTime(DateTimeZone.UTC).getMillis() / 1000;
        }
        return this;
    }
24642
public function cache($expires)
    {
        if ($expires === false) {
            $this->_headers['Expires'] = 'Mon, 26 Jul 1997 05:00:00 GMT';
            $this->_headers['Cache-Control'] = array(
                'no-store, no-cache, must-revalidate',
                'post-check=0, pre-check=0',
                'max-age=0'
            );
            $this->_headers['Pragma'] = 'no-cache';
        } else {
            $expires = is_string($expires) ? strtotime($expires) : $expires;
            $this->_headers['Expires'] = gmdate('D, d M Y H:i:s', $expires).' GMT';
            $this->_headers['Cache-Control'] = 'max-age='.($expires - time());
        }
        return $this;
    }
1183885
@SuppressWarnings(value="unchecked")
	public int setExpires(int deltaMinutes) {
		if(!isValid()) {
			throw new IllegalStateException("Impossible to change the sip application " +
					"session timeout when it has been invalidated !");
		}
		expired = false;
		if(logger.isDebugEnabled()) {
			logger.debug("Postponing the expiratin of the sip application session "
					+ key +" to expire in " + deltaMinutes + " minutes.");
		}
		if(deltaMinutes <= 0) {
			if(logger.isDebugEnabled()) {
				logger.debug("The sip application session "+ key +" won't expire anymore ");
			}
			// If the session timeout value is 0 or less, then an application session timer
			// never starts for the SipApplicationSession object and the container
			// does not consider the object to ever have expired
//			this.expirationTime = -1;
			if(expirationTimerTask != null) {
				cancelExpirationTimer();
				// Fix for Issue 1678 : SipApplicationSession.setExpires() doesn't work sometimes
				// the global sipApplicationSessionTimeout needs to be reset as well
				sipApplicationSessionTimeout = deltaMinutes;
			}
			return Integer.MAX_VALUE;
		} else {
			long deltaMilliseconds = 0;
//			if(expirationTimerTask != null) {
				//extending the app session life time
//				expirationTime = expirationTimerFuture.getDelay(TimeUnit.MILLISECONDS) + deltaMinutes * 1000 * 60;
				deltaMilliseconds = deltaMinutes * 1000L * 60;
//			} else {
				//the app session was scheduled to never expire and now an expiration time is set
//				deltaMilliseconds = deltaMinutes * 1000L * 60;
//			}
			// Fix for Issue 1678 : SipApplicationSession.setExpires() doesn't work sometimes
			// the global sipApplicationSessionTimeout needs to be reset as well
			sipApplicationSessionTimeout = deltaMilliseconds;
			expirationTime = System.currentTimeMillis() + deltaMilliseconds;
			if(logger.isDebugEnabled()) {
				logger.debug("Setting expirationTime to "+ expirationTime + " on sip application session " + key);
				logger.debug("Re-Scheduling sip application session "+ key +" to expire in " + deltaMinutes + " minutes");
				Calendar calendar = Calendar.getInstance();
				calendar.setTimeInMillis(expirationTime);
				logger.debug("sip application session "+ key +" will expires at " + new SimpleDateFormat().format(calendar.getTime()));
			}


			final long milisecondsToGive = deltaMilliseconds;


			//Run the timer in different transaction
			new Thread(){

				@Override
				public void run() {
					if(expirationTimerTask != null) {
						cancelExpirationTimer();
//						expirationTimerFuture = null;
					}
					expirationTimerTask = sipContext.getSipApplicationSessionTimerService().createSipApplicationSessionTimerTask(SipApplicationSessionImpl.this);
					expirationTimerTask = sipContext.getSipApplicationSessionTimerService().schedule(expirationTimerTask, milisecondsToGive, TimeUnit.MILLISECONDS);
				}

			}.start();


			return deltaMinutes;
		}
	}
1079394
@Override
    public byte[] set(byte[] key, byte[] value, int expireTime) {
        if (key == null) {
            return null;
        }
        Jedis jedis = getJedis();
        try {
            jedis.set(key, value);
            // -1 and 0 is not a valid expire time in Jedis
            if (expireTime > 0) {
                jedis.expire(key, expireTime);
            }
         } finally {
            jedis.close();
        }
        return value;
    }
965629
public function setExpire(\DateTime $expire = null)
    {
        $this->_expire = ($expire) ? $expire : null;

        return $this;
    }
1033211
public Expiring<T> handleFormer() {
		if (null == this.defaultExpireTime || null == this.defaultExpireUnit) {
			throw new UnsupportedOperationException(
					"There is no default expire info, call Expiring#withDefault(long, TimeUnit) first");
		}
		
		this.handleExistEls = true;
		return this;
	}
342312
public static void setExpiresHeader(final HttpServletResponse response, final long expiresSeconds) {
		// Http 1.0 header, set a fix expires date.
		response.setDateHeader(HttpHeaders.EXPIRES, System.currentTimeMillis() + expiresSeconds * 1000);
		// Http 1.1 header, set a time after now.
		response.setHeader(HttpHeaders.CACHE_CONTROL, "private, max-age=" + expiresSeconds);
	}
1168795
def expires_on(self):
    """"""
    timestamp = self._info.get('expirationTime', None)
    if timestamp is None:
      return None
    return _parser.Parser.parse_timestamp(timestamp)
1308028
def expires_at(self):
        """"""
        try:
            expires = min(sig.key_expiration for sig in itertools.chain(iter(uid.selfsig for uid in self.userids), self.self_signatures)
                          if sig.key_expiration is not None)

        except ValueError:
            return None

        else:
            return (self.created + expires)
39020
public function setMulti($items, $expire = 0) {
		if ($this->prefix != '') {
			$temp = $items;
			$items = [];
			foreach ($temp as $key => $val) {
				$key = $this->prefix.$key;
				$items[$key] = $val;
			}
		}
		$expire = intval($expire);
		return $this->cache->setMulti($items, $expire);
	}
531247
private final void setExpiration(long expirationInMinutes) {
	expirationInMilliseconds = System.currentTimeMillis()+ expirationInMinutes * 60 * 1000;
        signature = null;
        if (userData != null) {
            encryptedBytes = null;
            userData.addAttribute("expire", Long.toString(expirationInMilliseconds));
        } else {
            encryptedBytes = null;
        }
    }
551102
def ExpirePrefix(self, prefix):
    """"""
    for key in list(self._hash):
      if key.startswith(prefix):
        self.ExpireObject(key)
141247
private function setExpiration($expires_in)
    {
        $this->expiresAtTimestamp = time() + $expires_in;
        $this->expiresAt = date('Y-m-d H:i:s', time() + $expires_in);
    }
336474
public function setExpiry(int $expires = null):AccessToken{
		$now = time();

		if($expires!== null){
			$expires =  intval($expires);
		}

		$this->expires = self::EOL_UNKNOWN;

		if($expires === 0 || $expires === self::EOL_NEVER_EXPIRES){
			$this->expires = self::EOL_NEVER_EXPIRES;
		}
		elseif($expires > $now){
			$this->expires = $expires;
		}
		elseif($expires > 0 && $expires < self::EXPIRY_MAX){
			$this->expires = $now + $expires;
		}

		return $this;
	}
975006
public int getRealExpire(int expire, String expireExpression, Object[] arguments, Object result) throws Exception {
        Integer tmpExpire = null;
        if (null != expireExpression && expireExpression.length() > 0) {
            tmpExpire = this.getElValue(expireExpression, null, arguments, result, true, Integer.class);
            if (null != tmpExpire && tmpExpire.intValue() >= 0) {
                // 返回缓存时间表达式计算的时间
                return tmpExpire.intValue();
            }
        }
        return expire;
    }
547239
public function set($key, $value, $expire = null)
    {
        if (null === $expire) {
            $expire = $this->_expire;
        }
        return $this->_mc->set($key, $value, 0, $expire);
    }
1158269
func (s *GetObjectOutput) SetExpires(v string) *GetObjectOutput {
	s.Expires = &v
	return s
}