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
import datetime
import pytz
import sys
import time
@@ -39,16 +38,7 @@ class Weather(Thread):
self.join()
def currentClock():
clock = dt.utcfromtimestamp(int(time.time()))
clock = datetime.datetime(
year = clock.year,
month = clock.month,
day = clock.day,
hour = clock.hour,
minute = clock.minute,
second = clock.second,
tzinfo = pytz.UTC
)
clock = dt.utcfromtimestamp(int(time.time())).replace(tzinfo = pytz.UTC)
return clock
def run(self):