diff options
author | Riku Isokoski <riksu9000@gmail.com> | 2022-04-18 19:42:09 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-18 19:42:09 +0300 |
commit | ff73f67d6f0ac6dde480aa82b0c225377ce60d49 (patch) | |
tree | 53f52079d09bd042d79c5008c701444a992caaf3 /src/components/alarm | |
parent | 943a48f189937f1b80ff5483cd5ea8c1b9e199ce (diff) | |
parent | 78cab3604d307d48db5d2b38b54a00bbaaaf67ec (diff) |
Merge pull request #1009 from NeroBurner/AlarmController_allow_less_precice_system_time
AlarmController: allow loss of precision for alarmTime cast
Diffstat (limited to 'src/components/alarm')
-rw-r--r-- | src/components/alarm/AlarmController.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/components/alarm/AlarmController.cpp b/src/components/alarm/AlarmController.cpp index 28b328d5..11d96e7a 100644 --- a/src/components/alarm/AlarmController.cpp +++ b/src/components/alarm/AlarmController.cpp @@ -54,7 +54,8 @@ void AlarmController::ScheduleAlarm() { auto now = dateTimeController.CurrentDateTime(); alarmTime = now; - time_t ttAlarmTime = std::chrono::system_clock::to_time_t(alarmTime); + time_t ttAlarmTime = std::chrono::system_clock::to_time_t( + std::chrono::time_point_cast<std::chrono::system_clock::duration>(alarmTime)); tm* tmAlarmTime = std::localtime(&ttAlarmTime); // If the time being set has already passed today,the alarm should be set for tomorrow |