Moslems Must Observe the apparent movement of the sun across the sky in order to performs prayers.
There is no consensus on the times of the prayers among different Moslem factions and developing an algorithm was affected by this fact.
For example, Sun depression angle considered to calculate Fajr and Isha prayers are not agreed upon.
In the following table we can see these differences:

Any how, these calculations depend on the latitude and the declination. Before we are able to calculate these values, we have to calculate a number of things including the Julian day ,hour angle and equation of time.
Hour Angle =1/15 x cos-1((sin(elevation angle-sin(declination)sin(latitude))/cos(declination)x cos(latitude))
The Equation Of Time can be calculated by this formula:
EoT = 9.873 x sin(4PI*day/375 + 3.588) – 7.665 x (2PI *day / 365)
Zohr Time Can be calculated by the follwoing formula:
Zohr = 12 + TimeZome – longitude/15 – EoT/60 + delta.
delta is the time needed for the Sun to cross the meridian and is about 4-5 minutes.
Asr Prayer can be calculated by the following formula:
Asr = Zohr + Hour Angle/15
Maghreb time equation is as follows:
Maghreb = Zohr + (1/15) x arcsin( (sin(-0.833 °) – sin(declination)sin(latitude))/(cos(declination) cos(latitude)) )
For Fajr prayer it is :
Fajr = Zohr – (1/15) x arcsin((sin(-18 °)-sin(declination)sin(latitude)) / (cos(declination)cos(latitude)) )
Isha prayer :
Isha = Zohr + (1/15) x arcsin((sin(-18 °)-sin(declination)sin(latitude)) / (cos(declination)cos(latitude)) )
Prayer Times according to Moslem World League is already available in a previous post.
Following is the prayer times according to Shia Ithna-asharia , Leva Research Institute, Qum:
🕋
Islamic Prayers Times
Prayer | Time | Notes |
Fajr | If values are not valid ,use astronomical twilight time | |
Zohr | ||
Asr | ||
Maghreb | +(8-10 minutes).For Shia Muslims Use Civil Twilight-night Time | |
Isha | If values are not valid, use astronomical twilight time | |
AstroTwilight-morning | In Extreme latitudes, values can be nonvalid or appear negative. | |
NautiTwilight-morning | In Extreme latitudes, values can be nonvalid or appear negative. | |
CivilTwilight-morning | In Extreme latitudes, values can be nonvalid or appear negative. | |
CivilTwilight-night | In Extreme latitudes, values can be nonvalid or appear negative. | |
NautiTwilight-night | In Extreme latitudes, values can be nonvalid or appear negative. | |
AstroTwilight-night | In Extreme latitudes, values can be nonvalid or appear negative. |
In latitudes above 66° N or below 66° S , it could be light all day or dark all day. Calculations then are not possible
Android App
Download from Google Play