Use timedelta.total_seconds() to fetch seconds in uptime segment
Closes #143.
This commit is contained in:
parent
59c316cb34
commit
b918057c40
|
@ -109,7 +109,7 @@ def uptime(format='{days:02d}d {hours:02d}h {minutes:02d}m'):
|
|||
try:
|
||||
import psutil
|
||||
from datetime import datetime
|
||||
seconds = (datetime.now() - datetime.fromtimestamp(psutil.BOOT_TIME)).seconds
|
||||
seconds = int((datetime.now() - datetime.fromtimestamp(psutil.BOOT_TIME)).total_seconds())
|
||||
except ImportError:
|
||||
try:
|
||||
with open('/proc/uptime', 'r') as f:
|
||||
|
|
Loading…
Reference in New Issue