Skip to content

Commit

Permalink
Fix last seen edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishcoleman committed Oct 24, 2023
1 parent beb14c8 commit c552db6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/n2n-ctl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c552db6

Please sign in to comment.