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