Skip to main content

PEXPIRETIME

Syntax

PEXPIRETIME key

Time complexity: O(1)

ACL categories: @keyspace, @write, @fast

This command works exactly like EXPIRETIME but the absolute unix expiration timestamp of the key is returned in milliseconds instead of seconds.

Return

Integer reply, specifically:

  • The expiration unix timestamp, in milliseconds
  • -1 if the key exists but has no expiration time.
  • -2 if the key does not exist.

Examples

dragonfly> SET mykey "Hello"
OK
dragonfly> PEXPIRETIME mykey
(integer) -1
dragonfly> PEXPIRETIME missing
(integer) -2
dragonfly> EXPIRE mykey 100
(integer) 1
dragonfly> PEXPIRETIME mykey
(integer) 1755753267438