EXPIRETIME

Since 1.1.0Keys

Syntax

EXPIRETIME key
  • Flags: fast, readonly
  • ACL categories: @fast, @generic, @keyspace, @read
  • Arity: 2

Returns the Unix time, in seconds, at which key expires.

Reply

  • The time.
  • -1 if the key has no expiry.
  • -2 if the key does not exist.

Examples

> SET a 1
OK
> EXPIREAT a 4102444800
(integer) 1
> EXPIRETIME a
(integer) 4102444800