mirror of
https://github.com/KevinMidboe/homeChecker.git
synced 2025-10-29 09:30:27 +00:00
Added check for when time is not defined yet (NULL)
This commit is contained in:
0
homeCheck.py
Normal file → Executable file
0
homeCheck.py
Normal file → Executable file
@@ -41,6 +41,9 @@ def getTimes():
|
||||
return returnList
|
||||
|
||||
def convertTime(seconds):
|
||||
if not isinstance(seconds, (int, long, float)):
|
||||
return 'Null'
|
||||
|
||||
delta = float("%0.2f" % (time() - seconds))
|
||||
if delta >= 86400:
|
||||
return str(delta//86400) + ' days'
|
||||
|
||||
Reference in New Issue
Block a user