mirror of
https://github.com/sascha-hemi/waste-collection-ammerland.git
synced 2026-03-21 02:04:34 +01:00
Merge pull request #2 from Tenosiey/codex/fix-datetime.utcnow-deprecation-warning
Fix timezone warning in calendar export
This commit is contained in:
4
main.py
4
main.py
@@ -1,6 +1,6 @@
|
|||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta, UTC
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
# URL to the JSON file
|
# URL to the JSON file
|
||||||
@@ -94,7 +94,7 @@ def save_abfalltermine_to_ics(collection_days, filename="waste_collection.ics"):
|
|||||||
event = (
|
event = (
|
||||||
"BEGIN:VEVENT\n"
|
"BEGIN:VEVENT\n"
|
||||||
f"UID:{uid}\n"
|
f"UID:{uid}\n"
|
||||||
f"DTSTAMP:{datetime.utcnow().strftime('%Y%m%dT%H%M%SZ')}\n"
|
f"DTSTAMP:{datetime.now(UTC).strftime('%Y%m%dT%H%M%SZ')}\n"
|
||||||
f"SUMMARY:{abfall_type}\n"
|
f"SUMMARY:{abfall_type}\n"
|
||||||
f"DTSTART;VALUE=DATE:{start}\n"
|
f"DTSTART;VALUE=DATE:{start}\n"
|
||||||
f"DTEND;VALUE=DATE:{end}\n"
|
f"DTEND;VALUE=DATE:{end}\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user