Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What exactly is meant with PHPs php date.sunrise_zenith and php date.sunset_zenith

date.sunrise_zenith and date.sunset_zenith have been in PHP since Version 5.1, so it's there for more than 10 years. Unil now, I never had to use these functions, so I never did complain about the very bad manual in this point. No examples , no real explanations.... May be, it isn't used until now by other functions.... But what are the meanings? O.K,date.default_latitude and date.default_longitude

I find quickly: Search for a place in http://maps.google.de and the Result will be: If you click on "What's here?" First value is Latitude, second is Longitude. But what exactly is meant by date.sunrise_zenith and date.sunset_zenith?

First problem I have: Zenith, for me, it's when sun is quite above me at midday, so neither at sunset nor at sunrise.

What I found is that most examples use 90, so What does 90 mean? 90° above horizon? This could be, as this would be only possible only when day and night has same length only on March 21 and September 21 at equator. But, at every place of the world on March 21 and September 21, day and night have the same length. So this seems to be the reason, why most examples I found say that date.sunrise_zenith and date.sunset_zenith both are around 90 (°).

So, my question: How do I determine exactly these two values for a specific place, let's say Munich, Germany? Aren't there some guys involved in PHP who could add this information to php's manual? Thank you!

like image 873
Torsten Avatar asked Sep 09 '25 14:09

Torsten


1 Answers

It should be 90° but, due to refraction of Earth atmosphere, the sun is visible before its rise and after its set. That means that the center of the sun is 50 arc-minutes below the horizon, so we have to correct the zenith (90°) with this value to obtain the real time of sunrise and sunset.

That's why you have to use 90°50' as value for date.sunrise_zenith and date.sunset_zenith.

Some references here

like image 158
Toto Avatar answered Sep 12 '25 03:09

Toto