PTTL

Synopsis

PTTL key

Similar to TTL this command returns the remaining time to live of a key that has a timeout set, with the sole difference that TTL returns the amount of remaining time in seconds while PTTL returns it in milliseconds.

Return value

Returns TTL in milliseconds, encoded as integer response.

Examples

$ SET yugakey "Yugabyte"
"OK"
$ EXPIRE yugakey 10
(integer) 1
$ PTTL yugakey
(integer) 9995

See also

ttl, set, expire, expireat