Merge pull request #1009 from NeroBurner/AlarmController_allow_less_precice_system_time
AlarmController: allow loss of precision for alarmTime cast
This commit is contained in:
commit
ff73f67d6f
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue