Skip to content

Commit

Permalink
timedelta format
Browse files Browse the repository at this point in the history
  • Loading branch information
CristianNic committed Jul 15, 2020
1 parent f59eab4 commit b673edf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/archiware_p5.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ def nsdchat_check():
dictionary['port'] = int(dictionary['port'])
dictionary['uptime'] = int(dictionary['uptime'])

print(dictionary['uptime'])

# format time
import time
dictionary['uptime'] = time.strftime('%d %H:%M:%S', time.gmtime(dictionary['uptime']))
from datetime import datetime, timedelta

uptime = timedelta(seconds=(dictionary['uptime']))

dictionary['uptime'] = str(uptime)

print(dictionary['uptime'])
return(dictionary)

return dictionary

def main():
"""Main"""
Expand Down

0 comments on commit b673edf

Please sign in to comment.