YouTip LogoYouTip

Keys Pexpire

# Redis PEXPIRE Command [!(#) Redis Keys](#) The Redis PEXPIRE command works similarly to the EXPIRE command, but it sets the key's time to live in milliseconds, unlike the EXPIRE command which uses seconds. ### Syntax The basic syntax of the redis PEXPIRE command is as follows: PEXPIRE key milliseconds ### Available Version >= 2.6.0 ### Return Value Returns 1 if successfully set Returns 0 if key does not exist or setting fails ### Example First create a key and assign a value: redis> SET mykey "Hello" "OK" redis> PEXPIRE mykey 1500 (integer) 1 redis> TTL mykey (integer) 1 redis> PTTL mykey (integer) 1498 redis> [!(#) Redis Keys](#)
← Python3 Func SortedBootstrap4 Scrollspy β†’