Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

282
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda