diff --git a/Clock/PyQtPiClock.py b/Clock/PyQtPiClock.py index 3dd1f62..20825d6 100644 --- a/Clock/PyQtPiClock.py +++ b/Clock/PyQtPiClock.py @@ -161,12 +161,6 @@ def tick(): global sun, daytime, sunrise, sunset global bottom - if Config.DateLocale != "": - try: - locale.setlocale(locale.LC_TIME, Config.DateLocale) - except: - pass - now = datetime.datetime.now() try: if Config.clockUTC: @@ -327,7 +321,6 @@ def heighti(f): return f / 25.4 - def barom(f): return f * 25.4 @@ -1509,6 +1502,12 @@ def qtstart(): global objradar4 global sun, daytime, sunrise, sunset + if Config.DateLocale != "": + try: + locale.setlocale(locale.LC_TIME, Config.DateLocale) + except: + pass + dt = datetime.datetime.now(tz=tzlocal.get_localzone()) sun = suntimes(Config.location.lat, Config.location.lng) sunrise = sun.sunrise(dt)