Redis Expireat 命令

更新时间: 2019-07-07 15:54

Redis Expireat 命令用于以 UNIX 时间戳(unix timestamp)格式设置 key 的过期时间。key 过期后将不再可用。

语法

redis Expireat 命令基本语法如下:

redis 127.0.0.1:6379> Expireat KEY_NAME TIME_IN_UNIX_TIMESTAMP

可用版本

>= 1.0.0

返回值

设置成功返回 1 。 当 key 不存在或者不能为 key 设置过期时间时(比如在低于 2.1.3 版本的 Redis 中你尝试更新 key 的过期时间)返回 0 。

实例

首先创建一个 key 并赋值:

redis 127.0.0.1:6379> SET coderctokey redis
OK

为 key 设置过期时间:

redis 127.0.0.1:6379> EXPIREAT coderctokey 1293840000
(integer) 1
redis 127.0.0.1:6379> EXISTS coderctokey
(integer) 0

查看更多 Redis key 命令

Hit Refresh

Hit Refresh

Satya Nadella、Greg Shaw / HarperBusiness / 2017-9-26 / USD 20.37

Hit Refresh is about individual change, about the transformation happening inside of Microsoft and the technology that will soon impact all of our lives—the arrival of the most exciting and disruptive......一起来看看 《Hit Refresh》 这本书的介绍吧!

HTML 压缩/解压工具

HTML 压缩/解压工具

在线压缩/解压 HTML 代码

XML、JSON 在线转换

XML、JSON 在线转换

在线XML、JSON转换工具

HSV CMYK 转换工具

HSV CMYK 转换工具

HSV CMYK互换工具