From 62b014f5d56967e12edb128ab7ad81923feca075 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me?= Date: Wed, 28 Aug 2024 12:42:43 +0200 Subject: [PATCH] Allow odd timezones in sun.py (#1056) * fixes #1021 * fixes #1055 --- scripts/tools/sun.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/tools/sun.py b/scripts/tools/sun.py index 37d842938..e737f23de 100755 --- a/scripts/tools/sun.py +++ b/scripts/tools/sun.py @@ -14,7 +14,7 @@ load_envbash(config_file) # Use subprocess to get the local time offset from UTC -timezone = int(subprocess.check_output('echo $(date "+%:::z") | sed "s/\\([+-]\\)0\\?/\\1/"', shell=True, text=True)) +timezone = float(subprocess.check_output('echo $(date "+%:::z") | sed "s/\\([+-]\\)0\\?/\\1/" | sed "s/:30/.5/"', shell=True, text=True)) date = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(int(sys.argv[1]) - (timezone * 60 * 60)))