use python3.7 builtin function to properly parse iso8601

This commit is contained in:
Jan Koppe 2020-12-23 11:36:16 +00:00
parent 4190279e8b
commit 31db1ad426
2 changed files with 2 additions and 1 deletions

View File

@ -122,7 +122,7 @@ def events(scheduleUrl, titlemap={}):
if __name__ == "__main__":
events = list(events(scheduleUrl))
events = sorted(events, key=lambda x: datetime.datetime.strptime(x["datetime"], "%Y-%m-%dT%H:%M:%S%z"))
events = sorted(events, key=lambda x: datetime.datetime.fromisoformat(x["datetime"]))
with open("fahrplan.json", "w") as f:
json.dump(events, f)

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
lxml