Fix overflow in alarm calculation

This caused the alarm to fire multiple times per day