修改本页

Redis 命令 客户端 文档 社区 下载 问题 支持 许可

PEXPIRE key milliseconds

相关命令

Available since 2.6.0.

时间复杂度: O(1)

This command works exactly like EXPIRE but the time to live of the key is specified in milliseconds instead of seconds.

Integer reply, specifically:

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

例子

redis> SET mykey "Hello"

  1. OK

redis> PEXPIRE mykey 1500

  1. (integer) 1

redis> TTL mykey

  1. (integer) 1

redis> PTTL mykey

  1. (integer) 1499
redis>

Comments powered by Disqus

This website is open source software developed by Citrusbyte.

The Redis logo was designed by Carlos Prioglio. See more credits.

Sponsored by Redis Support