mirror of
https://github.com/devine-dl/devine.git
synced 2025-05-04 03:29:43 +00:00
Add support for JS-style 13-char timestamps to Cacher
This commit is contained in:
parent
ddf1c519e0
commit
36c530ccc6
@ -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}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user