PHP Classes

Calculate when Sun is at certain Zenith angle

Recommend this page to a friend!

      PHP Sun Position Calculator  >  All threads  >  Calculate when Sun is at certain...  >  (Un) Subscribe thread alerts  
Subject:Calculate when Sun is at certain...
Summary:When does the sun pass certain zenith angle
Messages:1
Author:Aapo Puskala
Date:2023-01-18 23:00:58
 

  1. Calculate when Sun is at certain...   Reply   Report abuse  
Picture of Aapo Puskala Aapo Puskala - 2023-01-18 23:00:58
Hello!

PHP's function date_sunrise allows to set the zenith angle, and then find out when the Sun crosses that angle. This way one can find out, for example, when the Sun goes above 15°.

Unfortunately, date_sunrise is deprecated since PHP 8.1.

The replacement function date_sun_info does not have this functionality. It can only tell you when the Sun passes some fixed angles (sunrise, sunset and various twilights). But it does not allow setting the zenith angle manually.

Would it be possible to include this functionality in your excellent class? you already calculate the zenith angle, so what I'm asking is doing the opposite of that - tell when the Sun is at a certain angle,