Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

289
Views
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!

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

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

about 4 years ago · Santiago Trujillo Report

0

The PHP functions date_sunrise() and date_sunset() use date.sunrise_zenith and date.sunset_zenith to calculate useful sunrise, sunset or twilight times, for example:

  • Sunrise: the point where the sun becomes visible.
  • Civil twilight: conventionally used to signify the start of dawn.
  • Nautical twilight: the point at which the horizon starts being visible at sea.
  • Astronomical twilight: the point at which the sun starts being the source of any illumination.

For each of the above there is an astronomical value of date.sunrise_zenith and date.sunset_zenith.

See examples in PHP Manual

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!