EXPIRETIME

Since 1.1.0KeysChanged in 1.2.1

Syntax

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

History

  • 1.2.1: acl categories: removed generic

Returns the Unix time, in seconds, at which key expires, rounded to the nearest second, as in Redis; before 1.2.1 it was rounded down. For the latest deadline a key can have, it is 9223372036854776.

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