modified: app.py

This commit is contained in:
SimolZimol
2026-04-21 09:43:07 +02:00
parent f59507007c
commit b25edc40b5

8
app.py
View File

@@ -202,7 +202,13 @@ def wetter():
# "Aktuell" = erste Stunde >= jetzt (UTC), sonst erste verfügbare # "Aktuell" = erste Stunde >= jetzt (UTC), sonst erste verfügbare
now_utc = _dt.datetime.now(_dt.timezone.utc).replace(tzinfo=None) now_utc = _dt.datetime.now(_dt.timezone.utc).replace(tzinfo=None)
now_local = _dt.datetime.now(_dt.timezone.utc).astimezone() # lokale Systemzeit inkl. Zeitzone try:
import zoneinfo
berlin = zoneinfo.ZoneInfo("Europe/Berlin")
except ImportError:
import pytz
berlin = pytz.timezone("Europe/Berlin")
now_local = _dt.datetime.now(berlin).strftime("%H:%M")
current_idx = 0 current_idx = 0
for i, h in enumerate(forecast): for i, h in enumerate(forecast):
dt = h["datetime"] dt = h["datetime"]