In summary, the equation to resolve sunrise and sunset times for a certain DoY (day of year) with a certain latitude is as follows: cos(ωo) = -tan(φ)×tan(δ)f
The sunrise equation as follows can be used to derive the time of sunrise and sunset for any solar declination and latitude in terms of local solar time when sunrise and sunset actually occur:
cos(ωo) = -tan(φ)×tan(δ)
where ωo is the hour angle in degrees at either sunrise (when negative value is taken) or sunset (when positive value is taken) in degree (°); φ is the latitude of the Earth in degree; δ is the sun declination in degrees.
The Earth rotates at the angular speed of 15°/hour and, therefore, ωo/15° gives the time of sunrise as the number of hours before the local noon, or the time of sunset as the number of hours after the local noon. Here the term local noon indicates the local time when the sun is exactly to the south or north or exactly overhead.
The convention is usually that the value of φ is positive in Northern Hemisphere and negative in Southern Hemisphere. And the value of δ is positive during the Northern Hemisphere summer and negative during the Northern Hemisphere winter.
Please note that the above equation is applicable only when indeed there is a sunrise or sunset when -90°+δ < φ < 90°-δ during the Northern Hemisphere summer, and when -90°-δ < φ < 90°+δ during the Northern Hemisphere winter. Out of these latitudinal ranges, it is either 24-hour daytime or 24-hour nighttime.
Also note that the above equation neglects the influence of atmospheric refraction (which lifts the solar disc by approximately 0.6° when it is on the horizon) and the non-zero angle subtended by the solar disc (about 0.5°). The times of the rising and the setting of the upper solar limb as given in astronomical almanacs correct for this by using the more general equation
strongmotive's equation gets you there, provided you know when local noon is. Local noon doesn't happen at 12:00 noon on your clock (your clock uses mean solar time vs apparent solar time). You need the difference between your longitude and the longitude used for your standard time (plus take into account daylight savings time), plus you need to account for the eccentricity of the Earth's orbit and the obliquity of the eccliptic (the two combined make up the equation of time, which you can look up in an astronomical almanac - unfortunately, I don't have a 2008 version available right now. The equation stays basically the same each year, but the coefficients change slightly due to precession/nutation).
Holy cattle, Batman! PF has a hyperlinked glossary!
Do you need to use an equation? In other words, are you asking because you need to program it into something or do it as an exercise for some reason, or are you simply trying to find any way to know the sunrise/sunset times for your area? If your question is more of a practical issue, the US Naval Observatory website has tables of sunrise and sunset times (along with civil, nautical and astrological twilight times too) that you can search by latitude and longitude. If you really need an equation, I'm afraid I'm not the one to help.
Moonbear, I need the equation for a program.
thanks strongmotive for your detailed explanation.
And BobG, i know its not exact 12:00
i already know for example, than since i live in France : UTC + 1 hour
and that my longitude is :7°11'
time is suposed to be : 24 / 360) * (7 + (11 / 60)) * 60 = 28.7333333
so UTC + 30 minutes about
so when my clock says 12:00 , its actually 11:30
and another question :
the maximum sun time is (sunrisetime + sunsettime) /2 right ? (if consider 24h clock)