Skip to main content

PEXPIREAT

Note

Official reference: PEXPIREAT.

Set key expiration using a Unix timestamp in milliseconds.

Syntax

PEXPIREAT key unix-milliseconds [NX | XX | GT | LT]

NX sets only absent expirations; XX changes existing expirations; GT/LT only extend/shorten them. An expiration at or before the current time deletes the key immediately.

Results

ReturnRowsContent
Update count--1 if timeout was set; 0 otherwise.

Example

SET demo:message hello
PEXPIREAT demo:message 2000000000000