From 36c530ccc62347d80e64e00f39ed8bc1d8bf85f9 Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Mon, 13 Mar 2023 22:48:08 +0000 Subject: [PATCH] Add support for JS-style 13-char timestamps to Cacher --- devine/core/cacher.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/devine/core/cacher.py b/devine/core/cacher.py index 71440ac..edc57e8 100644 --- a/devine/core/cacher.py +++ b/devine/core/cacher.py @@ -150,6 +150,8 @@ class Cacher: except ValueError: timestamp = float(timestamp) try: + if len(str(int(timestamp))) == 13: # JS-style timestamp + timestamp /= 1000 timestamp = datetime.fromtimestamp(timestamp) except ValueError: raise ValueError(f"Unrecognized Timestamp value {timestamp!r}")