summaryrefslogtreecommitdiff
path: root/redis/commands/core.py
diff options
context:
space:
mode:
authordvora-h <67596500+dvora-h@users.noreply.github.com>2022-03-07 01:33:57 +0200
committerGitHub <noreply@github.com>2022-03-07 01:33:57 +0200
commit1f2259fa3078d38048060a429837fb13f397686e (patch)
treea3b92ea4df329c9e4a733cb780055a6e9714df95 /redis/commands/core.py
parentf987a0cc86bd37aeaec3d73547c6176b651acd7b (diff)
downloadredis-py-1f2259fa3078d38048060a429837fb13f397686e.tar.gz
Add support for PEXPIRETIME (#1861)
* add pexpiretime * skip test
Diffstat (limited to 'redis/commands/core.py')
-rw-r--r--redis/commands/core.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/redis/commands/core.py b/redis/commands/core.py
index cdbb267..3595677 100644
--- a/redis/commands/core.py
+++ b/redis/commands/core.py
@@ -1800,6 +1800,15 @@ class BasicKeyCommands(CommandsProtocol):
when = int(time.mktime(when.timetuple())) * 1000 + ms
return self.execute_command("PEXPIREAT", name, when)
+ def pexpiretime(self, key: str) -> int:
+ """
+ Returns the absolute Unix timestamp (since January 1, 1970) in milliseconds
+ at which the given key will expire.
+
+ For more information check https://redis.io/commands/pexpiretime
+ """
+ return self.execute_command("PEXPIRETIME", key)
+
def psetex(
self,
name: KeyT,