mirror of
https://github.com/ntop/n2n.git
synced 2024-04-21 16:31:34 +00:00
Fix last seen edge case
This commit is contained in:
@@ -174,6 +174,10 @@ def str_table(rows, columns, orderby):
|
||||
|
||||
def num2timestr(seconds):
|
||||
"""Convert a number of seconds into a human time"""
|
||||
|
||||
if seconds == 0:
|
||||
return "now"
|
||||
|
||||
days, seconds = divmod(seconds, (60*60*24))
|
||||
hours, seconds = divmod(seconds, (60*60))
|
||||
minutes, seconds = divmod(seconds, 60)
|
||||
|
||||
Reference in New Issue
Block a user