Sunrise/sunset app times change during my day

I wonder if the app isn’t taking into account the local time zone for the device, as sometime during the day (I haven’t figured out exactly when, maybe around noon - and I’m located in Pacific Time) the times for sunrise and sunrise change slightly (by ~1min, which is expected day-to-day).

I think the change might be midnight GMT. Is that possible?

1 Like

That would be 4pm my time. I’ll check later today.

Yep - right at 4pm, the sunset time changed from 5:17pm to 5:18pm. So the solution is to only update the local sunrise/sunset times at midnight local time (not GMT).

Hi - just checking as I haven’t seen an updated app announcement. (Or, should I see one? How would I know if you’ve updated the app, anyway?)

Cc author @alanfleming.

I don’t caclulate this: I just pull the data from a Tidbyt-supplied function, which clearly updates on its own schedule, sorry.

Tbh you’ll be out by a minute or two at most: if you require more precision than that then you’re really using the wrong device, here!

But as with other Tidbyt apps that display the current time/date/temp/etc., there must be some local time zone adjustments made; else, I’d see GMT as my local time instead of the converted Pacific Time. For the sunrise/sunset times, they should correspond to the current day in local time.

Their sunrise/sunset module code is here, which seems to use this module here. and in that second link you can see how it is calculated.

@alanfleming is using the location and current time, but converting the sunrise/sunset into your location as well. It uses the current time I think at your location to get the sunrise/sunset for that day. I think it is using your local time to grab the sunrise/sunset time. The default is GMT if no location has been set though.

@alanfleming I don’t think there would be a difference if you also did now=time.now().in_location(location["timezone"]) on line 64 of your code because it should already be grabbing it from the local location anyways… You could maybe locally test that in the pacific time zone, but I don’t think there’d be a difference and like you said I think it would be maybe a minute or two anyways since it is constantly updating throughout the day anyways when it refreshes the image.