Daylight Hours in Sunnyvale, CA

Shishir Iyer
3 min readDec 24, 2017

The winter solstice, the shortest day of the year, was just a few days ago. It is the low point of a periodic cycle of changing daylight, a result of the Earth’s tilted axis which varies the amount of sunlight falling on certain parts of it as it orbits the Sun. After the winter solstice, the amount of daylight increases until the summer solstice, which normally occurs around June 21. From there, the amount of daylight decreases all the way until the winter solstice. The rate of increase or decrease also varies; near the solstices, the amount of daylight changes very slowly, a few seconds per day, but near the equinoxes (fall and spring), the amount of daylight changes at a much faster rate, around a few minutes per day. Below is an equation that approximates the amount of daylight for any given day of the year in Sunnyvale, California:

Graph from desmos.com

Here is how this equation works. Daylight varies throughout the year in approximately a sine / cosine fashion. Therefore, a cosine function has been used, as the amount of daylight hits a low point near the beginning of the year and near the end as well. It is multiplied by -2.583 because this is the amplitude of the function: the amount the maximum and minimum of the function varies from the “mid line.” A plain cosine function has an amplitude of 1. This term is negative so that the function has a minimum at the start of its period, as the actual cosine function has a maximum at the start of its period. It’s also phase shifted to the left by 10 (hence the t + 10 term) because the low point — the winter solstice — occurs 10 days before the end of the year. The t + 10 term is multiplied by 2π/365 in order to ensure that the period is 365 days. In the case of a leap year, this term is changed to π/183 to change the period to 366 days. The added 12.15 at the end is a vertical shift of the aforementioned “mid line,” which in a normal cosine function is 0, but is now 12.15. This is the average of the maximum and minimum amount of daylight, and is pretty close to 12. By the way, there is a small amount of error (around a few minutes) associated with this equation. Daylight does not exactly follow a sine or cosine wave pattern, and this error is generally more pronounced during the spring and fall months.

As stated before, this function is for the amount of daylight in Sunnyvale. But this function wouldn't work for a location at a different latitude, such as Seattle. It has a different daylight function. The amount of daylight also varies with latitude. The further from the equator you are, the more the daylight varies with the season. A place close to the North or South pole has very long days during the summer and very short days in the winter. At latitudes above the Arctic Circle, summer features constant sunlight (Land of the Midnight Sun), and winter is characterized by perpetual darkness. However, closer to the equator, the amount of daylight does not vary as much, and right at the equator, the amount of daylight would stay at 12 hours per day the whole year.

--

--