Update timestamp handling (#314)

Co-authored-by: DevilXD <DevilXD@users.noreply.github.com>
This commit is contained in:
BoandDevilXD authored and GitHub committed 2023-10-09 22:04:22 +02:00
1 parent 6b9aabb252
commit 2dd7a57344
1 file changed
+3
+3
View File
@@ -109,6 +109,9 @@ def json_minify(data: JsonType | list[JsonType]) -> str:
def timestamp(string: str) -> datetime:
try:
return datetime.strptime(string, "%Y-%m-%dT%H:%M:%S.%fZ").replace(tzinfo=timezone.utc)
except ValueError:
return datetime.strptime(string, "%Y-%m-%dT%H:%M:%SZ").replace(tzinfo=timezone.utc)