I’ve noticed one of my apps that worked forever, has stopped working, and tracked it down to sunsetTime returning the wrong date! I just ran this code:
Interesting. Taking a step back, if you’re trying to execute an action at sunrise/sunset, you could just subscribe to those events. It would be interesting to see if that is still giving the wrong time (check the scheduled executions in the IDE)
I’ll give that a shot again. I’m ultimately looking for an offset (ie, some time after sunrise and some time before sunset), but started off subscribing to those events. But found that I think it was too crowded at those times, so wouldn’t always be called/wasn’t reliable. I found by switching to the offsets, that fixed the issue.