make the datetime code more readable
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user