Redis Expireat 命令

Redis 教程 · 2019-03-06 18:44:04

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
EXISTS coderctokey
(integer) 0

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

标签: expireat

The Smashing Book

The Smashing Book

Jacob Gube、Dmitry Fadeev、Chris Spooner、Darius A Monsef IV、Alessandro Cattaneo、Steven Snell、David Leggett、Andrew Maier、Kayla Knight、Yves Peters、René Schmidt、Smashing Magazine editorial team、Vitaly Friedman、Sven Lennartz / 2009 / $ 29.90 / € 23.90

The Smashing Book is a printed book about best practices in modern Web design. The book shares technical tips and best practices on coding, usability and optimization and explores how to create succes......一起来看看 《The Smashing Book》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

MD5 加密
MD5 加密

MD5 加密工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换