TIMEX
TIMEX

Reputation: 271724

In Redis, how do I get the expiration date of a key?

What's the command I use to see how many seconds are remaining?

Upvotes: 52

Views: 31998

Answers (1)

dee-see
dee-see

Reputation: 24078

TTL key

See the documentation of the TTL command.

There is also a PTTL command since Redis 2.6 that returns the amount of time in milliseconds instead of seconds.

Upvotes: 80

Related Questions