make the datetime code more readable

This commit is contained in:
Sven Czarnian
2021-10-11 21:56:39 +02:00
parent 8b43991c50
commit ebea408267

View File

@@ -1,6 +1,5 @@
#!/usr/bin/env python #!/usr/bin/env python
import datetime
import pytz import pytz
import sys import sys
import time import time
@@ -39,16 +38,7 @@ class Weather(Thread):
self.join() self.join()
def currentClock(): def currentClock():
clock = dt.utcfromtimestamp(int(time.time())) clock = dt.utcfromtimestamp(int(time.time())).replace(tzinfo = pytz.UTC)
clock = datetime.datetime(
year = clock.year,
month = clock.month,
day = clock.day,
hour = clock.hour,
minute = clock.minute,
second = clock.second,
tzinfo = pytz.UTC
)
return clock return clock
def run(self): def run(self):