Commands.app

EXPIRE

Keys

Set key expiration time

Examples
Common usage examples

Expire in 60 seconds

EXPIRE mykey 60

Expire at Unix timestamp

EXPIREAT mykey 1735689600

Expire in 5000 milliseconds

PEXPIRE mykey 5000
Notes
  • Use TTL to check remaining time
Related Commands
You might also find these useful