Calculating Muslim Prayer Times

In Islam, Muslims are to perform 5 daily prayers. It is one of the fundamental pillars of Islam and a specific time is allocated for the performing of each prayer. In this article we are going to briefly describe these prayer times and how they can be calculated mathematically.




There are nine points of time in a day that helps us to determine accurately the exact time at which each prayer is to be performed and also for fasting. We are going to list each point of time and give a brief explanation of each time period.

  1. Imsak. This is the period slightly before Fajr (dawn). It marks the commencement of fasting in a day at which the eating of Sahur (meal before fasting) should stop.
  2. Fajr. Also known as dawn, it is the time at which the sky begins to move from darkness in to light.
  3. Sunrise. This is the time at which the sun gradually starts to appear above the horizon
  4. Dhuhr. This the time at which he sun begins to decline after rising to its highest point in the sky.
  5. Asr. The time when the length of any object’s shadow reaches a factor (usually 1 or 2) of the length of the object itself plus the length of that object’s shadow at noon.
  6. Sunset. At this point the sun disappears below the horizon
  7. Maghrib. This the time right after sunset.
  8. Isha. The time at which total darkness falls and there is not a trace of scattered light in the sky.
  9. Midnight. The mean time from sunset to sunrise (or from Maghrib to Fajr, in some schools of thought).


In order to calculate the specific prayer time of a location we should be able to determine the Longitude (Lng), Latitude (L) as well as the Local time zone of that location. The equation of time (EqT) is also obtained along with declination of the sun (D) using a specific algorithm.


Dhuhr = 12 + TimeZone – Lng/15 – EqT. This is the formula for Dhuhr, it calculates midday which is the point at which the sun rises to its highest in the sky.


The time difference between the mid-day and the time at which sun reaches an angle α below the horizon can be computed using the following formula:

Both astronomical sunrise and sunset and sunset occur at α=0. But due to refraction of light by terristial atmosphere, actual sunrise appears slightly before astronomical sunrise and actual sunset occurs slightly after astronomical sunset.

The formula for actual sunrise and sunset is as follows:

Sunrise = Dhuhr – T(0.833), Sunset = Dhuhr + T(0.833).


There is not a universal rule on the angle to be used in calculating Fajr and Isha. There are different views depending on your country or region. The table below illustrates the different conventions used in some countries.

Convention Fajr Angle Isha Angle
Muslim World League 18 17
Islamic Society of North America (ISNA) 15 15
Egyptian General Authority of Survey 19.5 17.5
Umm al-Qura University, Makkah 18.5 90 min after Maghrib 120 min during Ramadan
University of Islamic Sciences, Karachi 18 18
Institute of Geophysics, University of Tehran 17.7 14*
Shia Ithna Ashari, Leva Research Institute, Qum 16 14

* Isha angle is not explicitly defined in Tehran method.

For example, according to Muslim World League convention, Fajr = Dhuhr – T(18) and Isha = Dhuhr + T(17).


There are two different views when it comes to calculating the Asr prayer time.  The majority of schools (including Shafi’i, Maliki, Ja’fari, and Hanbali) say it is at the time when the length of any object’s shadow equals the length of the object itself plus the length of that object’s shadow at noon. The dominant opinion in the Hanafi school says that Asr begins when the length of any object’s shadow is twice the length of the object plus the length of that object’s shadow at noon.

The following formula computes the time difference between the mid-day and the time at which the object’s shadow equals t times the length of the object itself plus the length of that object’s shadow at noon:

Thus, in the first four schools of thought, Asr = Dhuhr + A(1), and in Hanafi school, Asr = Dhuhr + A(2).


The Sunni’s believe that the time for Maghrib prayer begins once the Sun has completely set beneath the horizon, that is, Maghrib = Sunset (some calculators suggest 1 to 3 minutes after Sunset for precaution). In the Shia’s view however, the dominant opinion is that as long as the redness in the eastern sky appearing after sunset has not passed overhead, Maghrib prayer should not be performed. It is usually taken into consideration by assuming a twilight angle like Maghrib = Dhuhr + T(4).


Midnight is generally calculated as the mean time from Sunset to Sunrise, i.e., Midnight = 1/2(Sunrise – Sunset). In Shia point of view, the juridical midnight (the ending time for performing Isha prayer) is the mean time from Sunset to Fajr, i.e., Midnight = 1/2(Fajr – Sunset).


Leave a Reply

Your email address will not be published. Required fields are marked *