forrestguice / SuntimesWidget

Android app (and widget collection) that displays sunlight and moonlight times.
GNU General Public License v3.0
350 stars 61 forks source link

Alarms do not compensate for daylight savings. #642

Open pfirestone opened 2 years ago

pfirestone commented 2 years ago

This is going to be hell to reproduce: I set an alarm before daylight savings time ended.

The next day (after daylight savings time ended) alarm sounded an hour later than expected: the interface says alarm was meant to sound at 6:07, but it in fact sounded at 7:07; system clock had already updated to reflect the change.

Suntimes version: 0.14.8 Android: 11

Unfortunately, this is all the information I have about this problem. Maybe the solution is to abolish daylight savings time. Thank you for the great application — other than this it's completely exceeded expectations and been extremely reliable.

forrestguice commented 2 years ago

Thanks for reporting. The scheduling code doesn't have any special DST handling, so I guess I'm not surprised this failed.

I've been trying to test daylight changes this past week and its definitely hell. e.g. it seems a lot of special behavior is tied to "automatic date/time", which has me considering crazy testing solutions (like running a local ntp server).

Maybe the solution is to abolish daylight savings time.

This works for me! I'm not used to changing clocks (no DST where I live).

There was a proposal in the US to "abolish dst" recently, but it turns out they really meant to make it permanent (and that seems even worse). Its a bit silly that its easier for us to collectively change the definition of time, than it is to change business hours and work schedules 🤷‍♂️

forrestguice commented 2 years ago

The latest patch v0.14.10 might handle this correctly. I'm not confident its tested well enough though, so I will leave this issue open.

I think any daylight change is accompanied by a time zone change, so listening for that change and rescheduling afterward (#643) should fix this too.

pfirestone commented 2 years ago

Thanks so much for the support! Hopefully that helps. I guess we'll have to wait until spring to see whether it works, since the wacky testing solutions might be more effort than they're worth.

Timo-Fi commented 2 years ago

Just my 2¢s, I have 23 daily Notifications (no Alarms), on Android 7, 11 and 12 devices, they were created many DST changes ago (right after it became possible to save the Alarms/Notifications as file), and this kind of behavior has never happened.

forrestguice commented 2 years ago

@Timo-Fi I believe the difference is your alarms/notifications are set to various solar "events". This issue describes a problem with "clock time" alarms (which are just alarms in a given timezone).

pfirestone commented 2 years ago

This issue describes a problem with "clock time" alarms (which are just alarms in a given timezone).

Yes, confirming that I set the alarm to sound at a particular time, rather than in response to a celestial event.

Timo-Fi commented 2 years ago

Hi, I just want to note that my intention was not an attempt to refute your findings. I just wanted to provide a bit of info. Surely the DST has to be taken into account in resolving the Local Time to trigger the celestial events, but quite likely that happens elsewhere.

forrestguice commented 2 years ago

Hi, I just want to note that my intention was not an attempt to refute your findings. I just wanted to provide a bit of info. Surely the DST has to be taken into account in resolving the Local Time to trigger the celestial events, but quite likely that happens elsewhere.

I understand. To clarify how it works, the alarms are mostly immune to DST since they are scheduled using UTC. The conversion to "local time" is only when displayed. For example, sunrise might read 6AM before the DST change, and 7AM after, but the actual time of sunrise itself is unchanged (so that alarm continues working as expected). Suppose the alarm is set for 6AM "clock time" instead - similar to the other alarm, after the DST change it also reads 7AM. That's not what people expect though - since the clock has been automatically moved back/forward, they expect their alarm to have adjusted too. Hope that makes sense - I actually find it very confusing.

I guess another way of describing it.. these "clock time" alarms repeat every 24 hours, except sometimes it needs to be 23 hours, and sometimes 25, because the definition of "6:00AM" is suddenly different.

Timo-Fi commented 1 year ago

@Timo-Fi I believe the difference is your alarms/notifications are set to various solar "events". This issue describes a problem with "clock time" alarms (which are just alarms in a given timezone).

Hi! Yes, I only have solar "events", ... happily so. The DST really offers nothing good.

My first msg here from mobile, I hope it ends to intended position.