Skip to content

Commit 52fdabe

Browse files
committed
Uptime: round seconds to the nearest minute
To match the behavior of `uptime` command
1 parent 846f4c0 commit 52fdabe

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/common/parsing.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,12 @@ void ffParseDuration(uint32_t days, uint32_t hours, uint32_t minutes, uint32_t s
198198
return;
199199
}
200200

201+
if(seconds >= 30)
202+
{
203+
minutes++;
204+
seconds = 0;
205+
}
206+
201207
if(days > 0)
202208
{
203209
ffStrbufAppendF(result, "%u day", days);

0 commit comments

Comments
 (0)