diff --git a/API/gimvicurnik/updaters/base.py b/API/gimvicurnik/updaters/base.py index af99bf6..58d3320 100644 --- a/API/gimvicurnik/updaters/base.py +++ b/API/gimvicurnik/updaters/base.py @@ -178,7 +178,7 @@ def handle_document(self, document: DocumentInfo, span: Span) -> None: # == DOCUMENT PROCESSING # Get the modified time if it is set, otherwise use the current time - created = document.created or datetime.datetime.now(datetime.UTC) + created = document.created or datetime.datetime.now(datetime.timezone.utc) modified = document.modified or created # Check if the document has changed without downloading it and comparing hashes diff --git a/API/gimvicurnik/updaters/timetable.py b/API/gimvicurnik/updaters/timetable.py index 6419829..a8015cc 100644 --- a/API/gimvicurnik/updaters/timetable.py +++ b/API/gimvicurnik/updaters/timetable.py @@ -4,7 +4,7 @@ import re import typing from collections import defaultdict -from datetime import datetime, UTC +from datetime import datetime, timezone from hashlib import sha256 import requests @@ -167,7 +167,7 @@ def _parse(self, document: Document | None, raw_data: str, new_hash: str, span: created = False document.type = DocumentType.TIMETABLE - document.modified = datetime.now(UTC) + document.modified = datetime.now(timezone.utc) document.url = self.config.url document.hash = new_hash self.session.add(document)