Skip to content

Commit

Permalink
fix timezone #patch
Browse files Browse the repository at this point in the history
  • Loading branch information
atareao committed Sep 8, 2024
1 parent f0ad54c commit a31e0ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/myweatherindicator.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import os
import time
import webbrowser
from datetime import datetime, UTC
from datetime import datetime, timezone
import logging
import socket
import sys
Expand Down Expand Up @@ -175,7 +175,7 @@ def update_widgets(self):
bool: True if any widget was updated, False otherwise.
"""
update = False
utcnow = datetime.now(UTC)
utcnow = datetime.now(timezone.utc)
for i in range(INDICATORS):
if self.widgets[i] is not None:
self.widgets[i].set_datetime(utcnow)
Expand Down Expand Up @@ -400,7 +400,7 @@ def load_preferences(self):
#
self.icon_light = configuration.get('icon-light')
#
utcnow = datetime.utcnow()
utcnow = datetime.now(timezone.utc)
for i in range(INDICATORS):
if self.preferences[i]['show'] and\
self.preferences[i]['widget']:
Expand Down Expand Up @@ -551,7 +551,7 @@ def on_pinit(self, _widget, _data, index):
Returns:
None
"""
utcnow = datetime.now(UTC)
utcnow = datetime.now()
self.widgets[index].is_above = not self.widgets[index].is_above
weather = self.widgets[index].weather_data
self.widgets[index].save_preferences()
Expand Down

0 comments on commit a31e0ea

Please sign in to comment.