Daylength since last solstice
Posted: Fri 25 Jan 2013 5:41 pm
Hi all.
I want to get this implemented on my site:
- Number of days since the last solstice
- Number of days until the next solstice.
- How much longer (or shorter) the day is since the last solstice. (daylength based on sunrise and sunset. Longitude and latitude are also essential to calculate this correctly)
Like:
Today is 45 days since last solstice and 137 days until next solstice
The day is 4 hours an 34 min longer than last solstice.
It seems that Cumulus not can provide webtags for this, so this must be calculated in another way.
I think this is possible to achieve in PHP or Javascript. I'm no expert at writing code, so I need help to get ahead.
I have tried to find examples of code to calculate this, but have so far found nothing that can help me further.
I would appreciate if someone can provide example code for this.
I want to get this implemented on my site:
- Number of days since the last solstice
- Number of days until the next solstice.
- How much longer (or shorter) the day is since the last solstice. (daylength based on sunrise and sunset. Longitude and latitude are also essential to calculate this correctly)
Like:
Today is 45 days since last solstice and 137 days until next solstice
The day is 4 hours an 34 min longer than last solstice.
It seems that Cumulus not can provide webtags for this, so this must be calculated in another way.
I think this is possible to achieve in PHP or Javascript. I'm no expert at writing code, so I need help to get ahead.
I have tried to find examples of code to calculate this, but have so far found nothing that can help me further.
I would appreciate if someone can provide example code for this.