Skip to content

Commit

Permalink
Use correct timezone name
Browse files Browse the repository at this point in the history
  • Loading branch information
filips123 committed Sep 27, 2024
1 parent 2483dfd commit 27d8611
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion API/gimvicurnik/updaters/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions API/gimvicurnik/updaters/timetable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 27d8611

Please sign in to comment.