Is there an algorithm for determining how much daylight there is?

You can use the Sunrise/Sunset Algorithm to calculate the start/end of each day, and then just subtract to get the amount of daylight.

Also, NOAA hosts an improved sunrise/sunset calculator which includes an online tool as well as links to their JavaScript source code and other resources.


Nice problem. Would this Sunset/Sunrise algorithm be helpful?

Source:

Almanac for Computers, 1990
published by Nautical Almanac Office
United States Naval Observatory
Washington, DC 20392