From e348dc1b3ccd33cd9ab4e7dbfe7968039127ca61 Mon Sep 17 00:00:00 2001 From: Justin Date: Thu, 31 Aug 2023 22:06:30 +0800 Subject: [PATCH] fixed timezone --- stockTicker.py | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/stockTicker.py b/stockTicker.py index 7e2fc37..24ee866 100755 --- a/stockTicker.py +++ b/stockTicker.py @@ -7282,12 +7282,15 @@ class StockTicker(): json.dump(settings1, f) settings = settings1['clock1'] + gmt1 = settings['timezone'] + if '+' in gmt1: + gmt = gmt1.replace('+', '-') + elif '-' in gmt1: + gmt = gmt1.replace('-', '+') + else: + gmt = gmt1 #TIMEZONE NOT WORKING?!?!?!!?!?!?!?!?!?? - timezone = pytz.timezone(settings['timezone']) - if '+' in timezone: - timezone = timezone.replace('+', '-') - elif '-' in timezone: - timezone = timezone.replace('-', '+') + timezone = pytz.timezone(gmt) font = graphics.Font() font.LoadFont("fonts/6x12.bdf") # Change this to the path of your desired font file font2 = graphics.Font() @@ -7555,11 +7558,15 @@ class StockTicker(): # Create a canvas to draw on canvas = self.double_buffer - timezone = pytz.timezone(settings['timezone']) - if '+' in timezone: - timezone = timezone.replace('+', '-') - elif '-' in timezone: - timezone = timezone.replace('-', '+') + gmt1 = settings['timezone'] + if '+' in gmt1: + gmt = gmt1.replace('+', '-') + elif '-' in gmt1: + gmt = gmt1.replace('-', '+') + else: + gmt = gmt1 + #TIMEZONE NOT WORKING?!?!?!!?!?!?!?!?!?? + timezone = pytz.timezone(gmt) # Set the font and text color font = graphics.Font() font.LoadFont("fonts/clR6x12.bdf")