PEXPIRETIME(3valkey)
π PEXPIRETIME π
okay bestie, this is a page from the Valkey Command Manual, and honestly? it's a little icon. let's get into it π«Ά
β¨ NAME β¨
pexpiretime β returns the expiration time of a key as a Unix milliseconds timestamp. yes, milliseconds. we're precise in this house π
β¨ SYNOPSIS β¨
PEXPIRETIME key
β¨ DESCRIPTION β¨
so here's the tea: PEXPIRETIME has the exact same semantic as EXPIRETIME from valkey-expiretime(7), no cap. the ONE difference? it hands you back the absolute Unix expiration timestamp in milliseconds instead of seconds. that's it. that's the whole vibe. millis not secs. π¦
β¨ REPLY β¨
you're gonna get one of these three, and only these three, periodt:
- valkey-protocol(7) Integer reply β the expiration Unix timestamp in milliseconds. slay, you got a real number β¨
- valkey-protocol(7) Integer reply β
-1if the key exists but has no associated expiration time. she's alive but she's immortal, no clock on her π - valkey-protocol(7) Integer reply β
-2if the key does not exist. not me finding out she was never there π
β¨ COMPLEXITY β¨
O(1) β constant time, instant, no waiting around. it's giving main character speed π
β¨ ACL CATEGORIES β¨
@fast @keyspace @read
β¨ HISTORY β¨
- Available since:
7.0.0π
β¨ EXAMPLES β¨
here's the whole thing in action, live from 127.0.0.1:6379:
127.0.0.1:6379> SET mykey "Hello"
OK
127.0.0.1:6379> PEXPIREAT mykey 33177117420000
(integer) 1
127.0.0.1:6379> PEXPIRETIME mykey
(integer) 33177117420000
set it, give it a big ol' millisecond deadline, then ask for the receipt. iconic behavior fr fr π₯
β¨ SEE ALSO β¨
go read these next bestie, they're all connected:
copy(3valkey), del(3valkey), dump(3valkey), exists(3valkey), expire(3valkey), expireat(3valkey), expiretime(3valkey), keys(3valkey), migrate(3valkey), move(3valkey), object(3valkey), object-encoding(3valkey), object-freq(3valkey), object-help(3valkey), object-idletime(3valkey), object-refcount(3valkey), persist(3valkey), pexpire(3valkey), pexpireat(3valkey), pttl(3valkey), randomkey(3valkey), rename(3valkey), renamenx(3valkey), restore(3valkey), scan(3valkey), sort(3valkey), sort_ro(3valkey), touch(3valkey), ttl(3valkey), type(3valkey), unlink(3valkey), wait(3valkey), waitaof(3valkey)
ok that's the whole page!! go forth and check your expiration times in milliseconds, you absolute legend π
version 9.0.0 Β· dated 2025-10-21 β mwah, catch you in the next manpage bestie π§β¨πΈ
π¦ 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