diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-05-11 13:36:20 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-05-11 13:36:20 +0900 |
commit | 0541b20361dd764ae1ad737fbf39fcd1aa807f9a (patch) | |
tree | cbbb70ced707e58963f7d9e5ab7de099e710ebb0 | |
parent | d5defb589b79974342d53cc59404b4a1c6b7405d (diff) |
cli: fix formatTimedelta()
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | gobgp/main.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gobgp/main.go b/gobgp/main.go index d86ae7b3..370d80ce 100644 --- a/gobgp/main.go +++ b/gobgp/main.go @@ -60,13 +60,12 @@ func formatTimedelta(d int64) string { u /= 60 mins := u % 60 u /= 60 - hours := u % 60 + hours := u % 24 days := u / 24 if days == 0 { return fmt.Sprintf("%02d:%02d:%02d", hours, mins, secs) } else { - hours -= days * 24 return fmt.Sprintf("%dd ", days) + fmt.Sprintf("%02d:%02d:%02d", hours, mins, secs) } } |