Redis TTL calculator

Convert a human duration, milliseconds, or a target date/time into the exact EXPIRE, PEXPIRE, EXPIREAT and PEXPIREAT commands.

Human duration → seconds/ms

3,600 s3,600,000 ms

EXPIRE

EXPIRE mykey 3600

PEXPIRE

PEXPIRE mykey 3600000

SET ... EX

SET mykey value EX 3600

Milliseconds → seconds

3,600 s

Target date/time → EXPIREAT/PEXPIREAT

Runs in your browser. Nothing you type is sent anywhere.

How this works

Do this against your live database in Tablyne.

Redis & Valkey GUI →

FAQ

What happens if I EXPIRE a key with a past time? +

Per the docs, EXPIRE/PEXPIRE with a non-positive TTL, or EXPIREAT/PEXPIREAT with a time in the past, deletes the key immediately instead of leaving it to expire.

Does renaming a key keep its TTL? +

Yes — RENAME transfers the TTL to the new key name.

Why use PEXPIRE instead of EXPIRE? +

PEXPIRE lets you set sub-second precision (milliseconds); EXPIRE only takes whole seconds.