mirror of
https://github.com/devine-dl/devine.git
synced 2025-05-04 11:39: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:
|
except ValueError:
|
||||||
timestamp = float(timestamp)
|
timestamp = float(timestamp)
|
||||||
try:
|
try:
|
||||||
|
if len(str(int(timestamp))) == 13: # JS-style timestamp
|
||||||
|
timestamp /= 1000
|
||||||
timestamp = datetime.fromtimestamp(timestamp)
|
timestamp = datetime.fromtimestamp(timestamp)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise ValueError(f"Unrecognized Timestamp value {timestamp!r}")
|
raise ValueError(f"Unrecognized Timestamp value {timestamp!r}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user