Page 1 of 1

Day/Night Block

Posted: Wed Jan 17, 2018 5:43 am
by Ken Good
The day/night block seems to be experiencing an error in counting down until sun rise. Here is what it showed at approximately 11:35 pm:

Image

It should be saying that there was a little over 7 hours until sunrise. I checked the counter and every time I refreshed it the number was larger. So it appears to be counting up and not down.

Thanks in advance.

Ken W. Good
http://www.BullardWeather.com

Re: Day/Night Block

Posted: Wed Jan 17, 2018 6:01 am
by Ken Good
At midnight the block resets and begins counting down correctly. So this is a problem that exists from sunset until midnight.

Ken

Re: Day/Night Block

Posted: Wed Jan 17, 2018 6:06 am
by Ken Good
This is my guess. It appears that until midnight, the block is counting up from something, but what is not clear. I bet it is counting up from the last sun rise and then at midnight it begins counting down again to the next sun rise. You see this with the countdown block too. Once the deadline passes, the block starts counting up instead of stopping.

Ken

Re: Day/Night Block

Posted: Thu Jan 18, 2018 12:48 am
by Ken Good
After sunset today, I reviewed this block again and I confirmed that after sunset, the counter begins counting forward from the last sunrise. It continues to count forward until midnight. Then it magically changes to counting down.

I looked at the coding and I was shocked, shocked to learn that it involved math (this is a joke). But seriously, I do not do math well. It just came out as Greek to me and I did not have a button to press to automatically translate it for me. Ha!

I will have to leave it to the vast multitude of people who are much smarter than myself.

Ken

Re: Day/Night Block

Posted: Sun Jan 28, 2018 9:32 pm
by Jachym
I suspect the problem is in TZ detection, it works fine for me. I think it incorrectly detects the date. Its not the math, its the TZ functions, this is what usually causes all time-related problems (like in the interactiveGraph).