Also catch ValueError when converting timestamp to datetime (#1329)

This commit is contained in:
JonnyWong16 2024-02-04 10:52:34 -08:00 committed by GitHub
parent e3d90a5945
commit 654ed506f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -329,7 +329,7 @@ def toDatetime(value, format=None):
return None
try:
return datetime.fromtimestamp(value)
except (OSError, OverflowError):
except (OSError, OverflowError, ValueError):
try:
return datetime.fromtimestamp(0) + timedelta(seconds=value)
except OverflowError: