Page 1 of 1

Daylength since last solstice

Posted: Fri 25 Jan 2013 5:41 pm
by Friday
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.

Re: Daylength since last solstice

Posted: Fri 25 Jan 2013 9:52 pm
by RayProudfoot
You could use this site. http://mycountdown.org/My_Countdown/My_ ... wn/widget/

I've used it to add a equinox countdown on mine. But it only counts down. You might struggle to find something that tells you how long ago something occured.

Re: Daylength since last solstice

Posted: Sat 26 Jan 2013 4:00 am
by beteljuice
But it only counts down
Once the event is past they count up as well ;)

Winter: http://mycountdown.org/tag.php?tag=winter+solstice
vernal: http://mycountdown.org/tag.php?search=equinox

UTC times of events: http://aa.usno.navy.mil/data/docs/EarthSeasons.php

Re: Daylength since last solstice

Posted: Sat 26 Jan 2013 9:55 am
by RayProudfoot
Clearly I didn't leave my winter solstice countdown running long enough. I changed the code on 21 Dec to a equinox countdown.