English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The Redis PEXPIREAT command is used to set the expiration time of the key in milliseconds. The key will no longer be available after expiration.
The basic syntax of the redis PEXPIREAT command is as follows:
redis 127.0.0.1:6379> PEXPIREAT KEY_NAME TIME_IN_MILLISECONDS_IN_UNIX_TIMESTAMP
>= 1.0.0
Success returns 1 . When the key does not exist or the expiration time cannot be set for the key (for example, in versions lower than 2.1.3 Returns 0 when you try to update the expiration time of a key in a version of Redis lower than the one you are using (
First create a key and assign a value:
redis 127.0.0.1:6379> SET w3codeboxkey redis OK
Set the expiration time for key:
redis 127.0.0.1:6379> PEXPIREAT w3codeboxkey 1555555555005 (integer) 1