mirror of
https://github.com/InfiniTimeOrg/InfiniTime.git
synced 2024-12-26 11:13:16 +03:00
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 New Issue
Block a user