~learn.
0:00 / 1:07
W06 · Notification platform

A reminder for 2:30 AM, on a night when 2:30 AM never happens

transcript

A user schedules a reminder for 2:30 AM. On that night, 2:30 AM never happens.

Daylight saving time. In spring, the clock jumps. 2 AM becomes 3 AM. That hour is skipped. So 2:30 is a time that never happens. Does the reminder ever fire? The lesson's scheduler normalises it. It lands at 3:30.

But here's the catch. In autumn, it's the other way round. 2 AM happens twice. Which one? Use the first occurrence.

So how do you store times? Not as bare local times. Store UTC, along with the user's time zone. Then convert at send time. 9 AM tomorrow, with a DST change tomorrow? The stored zone gets it right.

And quiet hours? Same trap, in the user's local time. So they're re-evaluated on every single notification.

Local time is for showing people. Not for storing schedules. Store UTC and the time zone. Convert at the last moment.

Full breakdown in the lecture.