PSETEX key milliseconds value

Available since 2.6.0.

Time complexity: O(1)

PSETEX works exactly like SETEX with the sole difference that the expire time is specified in milliseconds instead of seconds.

*Examples

redis> PSETEX mykey 1000 "Hello"

  1. "OK"

redis> PTTL mykey

  1. (integer) 999

redis> GET mykey

  1. "Hello"
redis>