企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# EXPIREAT **EXPIREAT key timestamp** [EXPIREAT](#expireat) 的作用和 [_EXPIRE_](expire.html) 类似,都用于为 `key` 设置生存时间。 不同在于 [EXPIREAT](#expireat) 命令接受的时间参数是 UNIX 时间戳(unix timestamp)。 **可用版本:** >= 1.2.0 **时间复杂度:** O(1) **返回值:** 如果生存时间设置成功,返回 `1` 。当 `key` 不存在或没办法设置生存时间,返回 `0` 。 ``` redis> SET cache www.google.com OK redis> EXPIREAT cache 1355292000 # 这个 key 将在 2012.12.12 过期 (integer) 1 redis> TTL cache (integer) 45081860 ```