diff --git a/app.py b/app.py index b9f7ac7..c2f3670 100644 --- a/app.py +++ b/app.py @@ -202,7 +202,13 @@ def wetter(): # "Aktuell" = erste Stunde >= jetzt (UTC), sonst erste verfügbare 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 for i, h in enumerate(forecast): dt = h["datetime"]