Kaynağa Gözat

make the datetime code more readable

Sven Czarnian 3 yıl önce
ebeveyn
işleme
ebea408267
1 değiştirilmiş dosya ile 1 ekleme ve 11 silme
  1. 1 11
      aman/com/Weather.py

+ 1 - 11
aman/com/Weather.py

@@ -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):