PEXPIREAT key milliseconds-timestamp

Available since 2.6.0.

Time complexity: O(1)

PEXPIREAT has the same effect and semantic as EXPIREAT, but the Unix time at which the key will expire is specified in milliseconds instead of seconds.

*Return value

Integer reply, specifically:

  • 1 if the timeout was set.
  • 0 if key does not exist.

*Examples

redis> SET mykey "Hello"

  1. "OK"

redis> PEXPIREAT mykey 1555555555005

  1. (integer) 1

redis> TTL mykey

  1. (integer) -2

redis> PTTL mykey

  1. (integer) -2
redis>