Search code examples
androidalarmmanagerutc

Why AlarmClockInfo is earlier than the act?


I was trying to get the next alarm clock, by the following which returns the next clock timestamp of utc wall time.

val alarmManager = getSystemService(Context.ALARM_SERVICE) as AlarmManager
val next = alarmManager.nextAlarmClock.triggerTime

If the next clock is at 19:00 of tomorrow, the next will result of 18:00 of tomorrow, what is the difference of utc wall time and utc time, I have googled for nothing.


Solution

  • Problem solved when I change a phone, there may be some fault on the first phone, because the result is not consistent when the alarm clock changes.