Redis PEXPIREAT 命令

Redis 教程 · 2019-03-06 19:11:49

Redis PEXPIREAT 命令用于设置 key 的过期时间,以毫秒计。key 过期后将不再可用。

语法

redis PEXPIREAT 命令基本语法如下:

redis 127.0.0.1:6379> PEXPIREAT KEY_NAME TIME_IN_MILLISECONDS_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> PEXPIREAT coderctokey 1555555555005
(integer) 1

点击查看所有 Redis 教程 文章: https://codercto.com/courses/l/33.html

标签: pexpireat

An Introduction to Probability Theory and Its Applications

An Introduction to Probability Theory and Its Applications

William Feller / Wiley / 1991-1-1 / USD 120.00

Major changes in this edition include the substitution of probabilistic arguments for combinatorial artifices, and the addition of new sections on branching processes, Markov chains, and the De Moivre......一起来看看 《An Introduction to Probability Theory and Its Applications》 这本书的介绍吧!

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

SHA 加密
SHA 加密

SHA 加密工具