Latest web development tutorials

Redis Expireat command

Redis key (key)

Redis Expireat command sets the key to UNIX timestamp (unix timestamp) format expiration time. key will expire no longer available.

grammar

redis Expireat basic command syntax is as follows:

redis 127.0.0.1:6379> Expireat KEY_NAME TIME_IN_UNIX_TIMESTAMP

Available versions

> = 1.0.0

return value

Set successfully returned. When the key does not exist or can not set the expiration time for the key (for example, in less than 2.1.3 version of Redis you try to update the key expiration time) returns 0.

Examples

First, create a key and assignment:

redis 127.0.0.1:6379> SET w3bigkey redis
OK

Set the expiration time for the key:

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

Redis key (key)