Fix alarm time calculating.