EXPIRETIME

Syntax
EXPIRETIME key
Available since:
Redis Open Source 7.0.0
Time complexity:
O(1)
ACL categories:
@keyspace, @read, @fast,

Returns the absolute Unix timestamp (since January 1, 1970) in seconds at which the given key will expire.

See also the PEXPIRETIME command which returns the same information with milliseconds resolution.

Examples

redis> SET mykey "Hello"
"id=1160995 addr=127.0.0.1:42480 laddr=127.0.0.1:6379 fd=12 name= age=144571 idle=0 flags=N db=0 sub=0 psub=0 ssub=0 multi=-1 watch=0 qbuf=26 qbuf-free=20448 argv-mem=10 multi-mem=0 rbs=1024 rbp=0 obl=0 oll=0 omem=0 tot-mem=22426 events=r cmd=client|info user=interwebz redir=-1 resp=2 lib-name= lib-ver=
"
redis> SET mykey "Hello"
Cannot destructure property 'error' of 'replies[i]' as it is undefined.
redis> EXPIREAT mykey 33177117420
Cannot destructure property 'error' of 'replies[i]' as it is undefined.
redis> EXPIRETIME mykey
Cannot destructure property 'error' of 'replies[i]' as it is undefined.
redis>

RESP2/RESP3 Reply

One of the following:


RATE THIS PAGE
Back to top ↑