Back to Redis

PSETEX

content/commands/psetex.md

latest1.0 KB
Original Source

PSETEX works exactly like [SETEX]({{< relref "/commands/setex" >}}) with the sole difference that the expire time is specified in milliseconds instead of seconds.

Examples

{{% redis-cli %}} PSETEX mykey 1000 "Hello" PTTL mykey GET mykey {{% /redis-cli %}}

Redis Software and Redis Cloud compatibility

| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | <span title="Supported">✅ Standard</span> <span title="Supported"><nobr>✅ Active-Active</nobr></span> | |

Return information

{{< multitabs id="psetex-return-info" tab1="RESP2" tab2="RESP3" >}}

Simple string reply: OK.

-tab-sep-

Simple string reply: OK.

{{< /multitabs >}}