Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

HPEXPIRETIME

Last updated
HPEXPIRETIME key FIELDS numfields field [field ...]
Group
Hash
Complexity
O(N) where N is the number of fields given
Arity
-5 (at least 5 words, counting the command name)
Flags
read-only, fast
Keys
first 1, last 1, step 1
HotKV Cloud
All plans
On-Premise
no license needed

HPEXPIRETIME works like HEXPIRETIME, but returns each field’s expiry as a Unix timestamp in milliseconds.

An array with one integer per field, in the order given, under both RESP2 and RESP3:

Value Meaning
-2 The field or the key does not exist.
-1 The field exists but has no expiry.
Positive integer The expiry as a Unix time in milliseconds.

The errors are the same as for HTTL.

127.0.0.1:6379> HSET promo:3 code "SPRING"
(integer) 1
127.0.0.1:6379> HPEXPIREAT promo:3 1924992000500 FIELDS 1 code
1) (integer) 1
127.0.0.1:6379> HPEXPIRETIME promo:3 FIELDS 1 code
1) (integer) 1924992000500

Same as Redis 7.4. Valkey 8 does not have hash field expiration.

HEXPIRETIME, HPEXPIREAT, HPTTL, PEXPIRETIME