From b1d0f4afabc8fb7b4c28e03a693e28f77e699ce5 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 5 May 2023 14:08:47 -0400 Subject: [PATCH] correct timer time output format for timeouts > 24 hours --- src/timer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/timer.cpp b/src/timer.cpp index f97449e797..409135cbaf 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -249,8 +249,8 @@ void Timer::modify_params(int narg, char **arg) // format timeout setting std::string timeout = "off"; if (_timeout >= 0) { - std::time_t tv = _timeout; - timeout = fmt::format("{:%H:%M:%S}", fmt::gmtime(tv)); + std::tm tv = fmt::gmtime((std::time_t) _timeout); + timeout = fmt::format("{:02d}:{:%M:%S}", tv.tm_yday * 24 + tv.tm_hour, tv); } utils::logmesg(lmp, "New timer settings: style={} mode={} timeout={}\n", timer_style[_level],