Set expiry on a key as a unix timestamp in ms.
514016
function setExpiry(key, ms, req) {
  var rval = this.getRawKey(key);
  if(rval === undefined) return 0;
  // expiry is in the past or now, delete immediately
  // but return 1 to indicate the expiry was set
  if(ms <= Date.now()) {
    this.delKey(key, req);
    return 1;
  }
  if(!this._expires[key]) {
    this._ekeys.push(key);
  }
  this._expires[key] = ms;
  rval.e = ms;
  return 1;
}
1180711
function setExpiresIn($expiry)
    {
        $this->expiresIn = $expiry;
        $this->datetimeExpiration = $this->getDateTimeExpiration();
        return $this;
    }
299209
public Long expireAt(Object key, long unixTime) {
		Jedis jedis = getJedis();
		try {
			return jedis.expireAt(keyToBytes(key), unixTime);
		}
		finally {close(jedis);}
	}
19342
public void setExpiry(Date expire) {
        addField(SubscribeOptionFields.expire, FormField.Type.text_single);
        setAnswer(SubscribeOptionFields.expire.getFieldName(), XmppDateTime.formatXEP0082Date(expire));
    }
450939
def set_mtime(self, name, mtime, size):
        """"""
        self.check_write(name)
        os.utime(os.path.join(self.cur_dir, name), (-1, mtime))
941030
def set_timestamp(self, timestamp=str(datetime.datetime.utcfromtimestamp(time.time()))):
        
        self.timestamp = timestamp
502508
def expire_at(self, key, expiry, **opts):
        """"""
        key, store = self._expand_opts(key, opts)
        data = store.get(key)
        if data is not None:
            data = list(data)
            data[EXPIRY_INDEX] = expiry
            store[key] = tuple(data)
        else:
            raise KeyError(key)
702577
def expire(key, seconds, host=None, port=None, db=None, password=None):
    '''
    
    '''
    server = _connect(host, port, db, password)
    return server.expire(key, seconds)
408720
def _expires(name):
    '''
    
    '''
    cert_file = _cert_file(name, 'cert')
    # Use the salt module if available
    if 'tls.cert_info' in __salt__:
        expiry = __salt__['tls.cert_info'](cert_file)['not_after']
    # Cobble it together using the openssl binary
    else:
        openssl_cmd = 'openssl x509 -in {0} -noout -enddate'.format(cert_file)
        # No %e format on my Linux'es here
        strptime_sux_cmd = 'date --date="$({0} | cut -d= -f2)" +%s'.format(openssl_cmd)
        expiry = float(__salt__['cmd.shell'](strptime_sux_cmd, output_loglevel='quiet'))
        # expiry = datetime.datetime.strptime(expiry.split('=', 1)[-1], '%b %e %H:%M:%S %Y %Z')

    return datetime.datetime.fromtimestamp(expiry)
914875
def expire(self, name, time):
        
        with self.pipe as pipe:
            return pipe.expire(self.redis_key(name), time)
886495
public function setCheckExpiry()
    {
        try {
            $this->expired = false;
            $this->cacheFile->put(Carbon::now()->getTimestamp());
        } catch (IOException $e) {
            // Something went wrong
        }
    }
818570
def set(self, key, value):
        
        self._check_limit()
        _expire = time.time() + self._timeout if self._timeout else None
        self._store[key] = (value, _expire)
1331626
function set(key, value /*, exflag, secs, pxflag, ms, xflag, req*/) {
  var i
    , arg
    // expiry flag: EX | PX
    , flag
    // expiry value: number
    , expiry
    // exists flag: NX | XX
    , xflag
    // request object when available
    , req;

  for(i = 0;i < arguments.length;i++) {
    arg = arguments[i];
    if(typeof arg === 'object') {
      req = arg;
    }else if(arg === Constants.NX || arg === Constants.XX) {
      xflag = arg;
    }else if(arg === Constants.EX || arg === Constants.PX) {
      flag = arg;
      expiry = arguments[++i];
    }
  }
  return this.setKey(key, value, flag, expiry, xflag, req) || null;
}
709424
public void setExpiryTime(long pExpiryTime) {
        long oldEexpiryTime = expiryTime;

        expiryTime = pExpiryTime;

        if (expiryTime < oldEexpiryTime) {
            // Expire now
            nextExpiryTime = 0;
            removeExpiredEntries();
        }
    }
1297379
def save(self, expires=None):
        """"""

        if expires is None:
            expires = self.expires
        s = self.serialize()
        key = self._key(self._all_keys())
        _cache.set(key, s, expires)
905007
private function setValue($key, $value)
    {
        $this->$key = $value;

        if ($key == 'expires_in') $this->setExpiration($value);
    }
10749
def pexpireat(self, key, timestamp):
        
        if not isinstance(timestamp, int):
            raise TypeError("timestamp argument must be int, not {!r}"
                            .format(timestamp))
        fut = self.execute(b'PEXPIREAT', key, timestamp)
        return wait_convert(fut, bool)