[SOLVED] Astro sun daylength incorrect

I use the astro sun binding daylength channel. The value reported is short about 7 minutes. I use a JS transform the value to hours:minutes. I thought the transform might be have a bug, but the value fed into it via the binding is short by about 7 minutes. Sunrise and sunset times are correct and the difference between the two is consistent with what I can find as the correct daylenght value. Has anyone else run into this issue?
Thanks

OK, there are a bunch of questions you need to answer to figure out whether this is a bug or just a side effect of calculating the daylength using different events.

For example, one will get a different daylength using the start of Nautical Dawn to the end of Nautical Dusk or using the end of Civil Dawn to the beginning of Civil Dusk.

So first you need to find out which of the sunrise and sunset events your other source uses. Then you need to find out which events Astro uses. If they are the same events then there is indeed a problem. If they are not, then the difference is probably caused by the events chosen to calculate the value.

If I’m not mistaken the binding uses:

daylightRange = new Range(sun.getRise().getEnd(), sun.getSet().getStart());

In other words, the code does not use the exact times of rise and set, which you most probably do understand as an exact time. Instead it uses the end of the duration of the complete rise event, which is a time range. And the start of the set event range.

1 Like

That makes sense. Thanks for the reply.

“My Break-Dancing days are over, but there’s always the Funky Chicken” – The Full Monty