fixed timezone

This commit is contained in:
Justin 2023-08-31 22:06:30 +08:00 committed by GitHub
parent c059825718
commit e348dc1b3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7282,12 +7282,15 @@ class StockTicker():
json.dump(settings1, f) json.dump(settings1, f)
settings = settings1['clock1'] 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 NOT WORKING?!?!?!!?!?!?!?!?!??
timezone = pytz.timezone(settings['timezone']) timezone = pytz.timezone(gmt)
if '+' in timezone:
timezone = timezone.replace('+', '-')
elif '-' in timezone:
timezone = timezone.replace('-', '+')
font = graphics.Font() font = graphics.Font()
font.LoadFont("fonts/6x12.bdf") # Change this to the path of your desired font file font.LoadFont("fonts/6x12.bdf") # Change this to the path of your desired font file
font2 = graphics.Font() font2 = graphics.Font()
@ -7555,11 +7558,15 @@ class StockTicker():
# Create a canvas to draw on # Create a canvas to draw on
canvas = self.double_buffer canvas = self.double_buffer
timezone = pytz.timezone(settings['timezone']) gmt1 = settings['timezone']
if '+' in timezone: if '+' in gmt1:
timezone = timezone.replace('+', '-') gmt = gmt1.replace('+', '-')
elif '-' in timezone: elif '-' in gmt1:
timezone = timezone.replace('-', '+') gmt = gmt1.replace('-', '+')
else:
gmt = gmt1
#TIMEZONE NOT WORKING?!?!?!!?!?!?!?!?!??
timezone = pytz.timezone(gmt)
# Set the font and text color # Set the font and text color
font = graphics.Font() font = graphics.Font()
font.LoadFont("fonts/clR6x12.bdf") font.LoadFont("fonts/clR6x12.bdf")