HEXPIRETIME(3valkey)
π HEXPIRETIME π
okay bestie, welcome to the Valkey Command Manual entry for hexpiretime β yes that's the manual section 3valkey, she's a real one π
β¨ NAME β¨
hexpiretime β returns Unix timestamps in seconds since the epoch at which the given key's field(s) will expire π°οΈ
β¨ SYNOPSIS β¨
HEXPIRETIME key FIELDS numfields field [field...]
β¨ DESCRIPTION β¨
so the HEXPIRETIME command returns the absolute Unix timestamp (since January 1, 1970) in seconds at which the given hash field(s) will expire β or -1 if the hash field doesn't have an expiration time. no cap, that's it, that's the whole vibe πΈ
also go peek at the valkey-hpexpiretime(7) HPEXPIRETIME command, which returns the same info but with milliseconds resolution. she's the precise one π
β¨ REPLY β¨
valkey-protocol(7) Array reply: a list of values associated with the result of getting the absolute expiry timestamp of the specific fields, in the same order as they are requested. periodt.
-2: Field does not exist in the provided hash key, or the hash key is empty. π-1: Field exists in the provided hash key, but has no expiration associated with it. π«Άvalkey-protocol(7)Integer: The expiration time associated with the hash key field, in seconds. β±οΈ
β¨ COMPLEXITY β¨
O(N) where N is the number of specified fields. linear, bestie, she's not doing anything fancy π
β¨ ACL CATEGORIES β¨
@fast @hash @read β yes she's in three clubs and she's thriving π
β¨ HISTORY β¨
- Available since:
9.0.0β
β¨ EXAMPLES β¨
127.0.0.1:6379> HSET myhash f1 v1 f2 v2 f3 v3
(integer) 3
27.0.0.1:6379> HEXPIREAT myhash 1754846600 FIELDS 2 f2 f3
1) (integer) 1
2) (integer) 1
127.0.0.1:6379> HEXPIRETIME myhash FIELDS 4 f1 f2 f3 non-exist
1) (integer) -1
2) (integer) 1754846600
3) (integer) 1754846600
4) (integer) -2
look at her go π f1 says "no expiration bestie" (-1), f2 and f3 are giving their exact timestamps, and non-exist is justβ¦ not there (-2). iconic behavior honestly π¦
β¨ SEE ALSO β¨
hdel(3valkey), hexists(3valkey), hexpire(3valkey), hexpireat(3valkey), hget(3valkey), hgetall(3valkey), hgetex(3valkey), hincrby(3valkey), hincrbyfloat(3valkey), hkeys(3valkey), hlen(3valkey), hmget(3valkey), hmset(3valkey), hpersist(3valkey), hpexpire(3valkey), hpexpireat(3valkey), hpexpiretime(3valkey), hpttl(3valkey), hrandfield(3valkey), hscan(3valkey), hset(3valkey), hsetex(3valkey), hsetnx(3valkey), hstrlen(3valkey), httl(3valkey), hvals(3valkey) β the whole hash girl squad, go say hi π
and that's the tea β this page is from version 9.0.0, dated 2025-10-21, and yeah she's filed under HEXPIRETIME(3valkey) in the Valkey Command Manual. mwah π bye bestie, go check your expiry times πβ¨
π¦ where this page comes from
- fedora 44: valkey-doc 9.0.3-2.fc44 Β· CC-BY-SA-4.0
- fedora 44: valkey-doc 9.0.6-1.fc44 Β· CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms