From 52fdabeb2e6e3db15e1527a2ec89aa2c368f239e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 1 Apr 2025 19:33:23 +0800 Subject: [PATCH] Uptime: round seconds to the nearest minute To match the behavior of `uptime` command --- src/common/parsing.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/common/parsing.c b/src/common/parsing.c index dce4cef02..d427dbbea 100644 --- a/src/common/parsing.c +++ b/src/common/parsing.c @@ -198,6 +198,12 @@ void ffParseDuration(uint32_t days, uint32_t hours, uint32_t minutes, uint32_t s return; } + if(seconds >= 30) + { + minutes++; + seconds = 0; + } + if(days > 0) { ffStrbufAppendF(result, "%u day", days);