From c209338ade721d6a82e41bb0e36d0aeb31026e24 Mon Sep 17 00:00:00 2001 From: Mateusz Piesta Date: Mon, 16 May 2022 15:54:24 +0200 Subject: [PATCH] [BH-1487] Seconds are not set to zero When setting the new time from the settings application, zero current seconds counter to have time set precisely. --- .../apps/application-bell-settings/models/TimeUnitsModel.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/products/BellHybrid/apps/application-bell-settings/models/TimeUnitsModel.cpp b/products/BellHybrid/apps/application-bell-settings/models/TimeUnitsModel.cpp index be386cae9e8b74bed77aff7ace400a6cbfba8116..61d1faffacc338d78844f9e83fe137054f1715a7 100644 --- a/products/BellHybrid/apps/application-bell-settings/models/TimeUnitsModel.cpp +++ b/products/BellHybrid/apps/application-bell-settings/models/TimeUnitsModel.cpp @@ -74,13 +74,14 @@ namespace app::bell_settings void TimeUnitsModel::saveData() { const auto newTime = timeSetListItem->timeSetFmtSpinner->getTime(); - const auto time_tm = std::localtime(&newTime); + auto time_tm = std::localtime(&newTime); const auto newFmt = timeFmtSetListItem->getTimeFmt(); LOG_INFO("Setting new time: %d:%d fmt: %s", time_tm->tm_hour, time_tm->tm_min, utils::time::Locale::format(newFmt).c_str()); - sendRtcUpdateTimeMessage(newTime); + time_tm->tm_sec = 0; + sendRtcUpdateTimeMessage(std::mktime(time_tm)); sendTimeFmtUpdateMessage(newFmt); }