correct timer time output format for timeouts > 24 hours

This commit is contained in:
Axel Kohlmeyer
2023-05-05 14:08:47 -04:00
parent 15116a0456
commit b1d0f4afab

View File

@ -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],