Wednesday, January 23, 2008

Calculating Muslims' Prayers Times

Calculating Muslims' Prayers Times

I thought how to mathematically compute prayer times? Then I found that calculations of prayers times are more complex than I imagined.

Do you think that Douhr at 1 JAN 2005 is at the same time of 1 JAN 2008 for the same location?
Do you think that prayer times are the same for locations of the same longitude for the same date?

Are there any parameters other than date and location that could be taken into account when calculating prayers times?
What about prayers times for locations near poles where day can be as long as months?

Let's start by Douhr:

Douhr starts after midday. Computation of Douhr time depends on the location and the date:

L is longitude of the location in degrees.
EQT is equation of time.

Z is Douhr time in hours.

Since Time zone and L are constant over time i.e. depends only on location, the only time varying element is EQT equation of time which is defined as the difference between Local Apparent Time and Mean Solar Time in minutes. Time measured from sundial is the Local Apparent time while Mean Solar time is that of a clock. This difference arose from the fact that the earth's orbit around sun isn't a circle, but an ellipse. Other reason is the angle of obliquity which is the angle between that the plane of the Equator and the plane of the Earth's orbit around the sun.

Variation of EQT over the year

You can notice that there are 4 days of zero EQT Apr 15, Jun 14, Sep 2 and Dec 25.

Accurate calculation of EQT depends on the Julian day which a count of days since Jan 1 4713 BC. Some EQT graphs are inverted, simply add EQT to equation of Z instead of subtraction.

A good approximation of Equation of time:

229.18*(0.000075+0.001868*cos(rads) - 0.032077*sin(rads) - 0.014615*cos(2*rads) - 0.040849*sin(2*rads))
This computation depends only on the day of year thus it's accurate only near 2005.

Fajr and Isha:

Fajr and Isha depend on Duhr as follows:

Fajr = Duhr – Tw(Ө)
Isha = Duhr + Tw(Ө)
Tw(Ө) is the period from noon till a twilight angle Ө.

Twilight: earth's atmosphere scatters sun light. In the absence of atmosphere on earth there would be no sunlight after sunset and before sunrise. So, Twilight causes gradual decrease of sunlight.
Twilight angle is the angle between line reaching sun's center and the horizon. Sun's center must be below it.

Greater twilight angle leads to earlier Fajr and later Isha.

This table represents conventions used to choose twilight angle

Convention Fajr Angle
Isha Angle
Leva Research Institute, Qom, Iran 16 14
University of Islamic Sciences, Karachi 18 18
Islamic Society of North America (ISNA), USA 15 15
Muslim World League (MWL) 18 17

Umm al-Qura, Makkah, Saudi Arabia

19 90 mins after Maghrib
Egyptian General Authority of Survey 19.5 17.5

To imagine twilight go to seaside at sunset and observe the sun gradually disappears , when you see the center of the sun at the horizon level , then the twilight angle is just near 0. Now the sun disappears and still sunlight is observable, that's twilight. Twilight ends when no sunlight is seen. The same can be done at sunrise.

Twilight before sunrise

Tw(Ө) is the period from noon till a twilight angle Ө:

Where lat is latitude of the position.
D is declination angle.

Calculation of D depends on location and Julian date.
Other approximation for Declination angle is:

D =
0.006918 - 0.399912*cos(rads) + 0.070257*sin(rads) - 0.006758*cos(2*rads) + 0.000907*sin(2*rads) - 0.002697*cos(3*rads) + 0.00148*sin(3*rads)

Variation of declination angle over the year

Sunrise (Shrook) and Sunset (Maghrib):

Similar to Fajr and Isha but with twilight angle of 0.8333.

Sunrise = Duhr – Tw(0.8333)
Sunset = Duhr + Tw(0.8333)

Sometimes more accurate measures can be obtained by taking into account height above sea level.

Where H is height above sea level in meters.


According to Shafii, Hanbaly and Maliky mathab Asr starts when the length of an object's shadow equals the its length plus the length of its shadow at noon. While to Hanafi mathab Asr starts when the length of an object's shadow equals twice its length plus the length of its shadow at noon.
So ,

Asr = Z + offset
Where Mathab = 1 for Shafaii and 2 for Hanafi.


To compute prayer times we need:
  1. Know the location (latitude - longitude), time zone and date.
  2. Compute Julian day, equation of time and declination angle.
  3. Start by Douhr.
  4. Then, compute Maghrib and sunrise.
  5. After that, compute Fajr and Isha using appropriate convention.
  6. Finally, compute Asr according to desired mathab.
Try to work out these calculations by hand.


Some astronomical facts:
The real helpful and correct source about prayer times.
Julian day and Equation of time calculator Javascript! Get its source to know method of calculation!
Declination angle, sunrise, sunset PHP calculations step by step!


Russoue said...

Assalamu Alaikum brother,

Can you please tell me what the value of TimeZone should be? I live in CST (GMT -6) in U.S. Should the value for me be -6? While calculating EQT I need to calculate Julian Date. Suppose, right now at 11:29 PM on the 17th February, 2009 I want to calculate the time of Dhuhr. What should be the date and time to calculate the Julian Date? I am wondering about the hour, minute and second part (others are obvious).


Anonymous said...

I found this site using [url=][/url] And i want to thank you for your work. You have done really very good site. Great work, great site! Thank you!

Sorry for offtopic

Anonymous said...

Who knows where to download XRumer 5.0 Palladium?
Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!

RUSHI said...

Those Muslims who lives in New York City, USA and they want to know about Salat times have a look at Islamic prayer times NYC. Namaz is the vital pillar of Islam.

RUSHI said...

Those Muslims who live in Sydney, Australia and they find a problem related to Sydney prayer times, then have a look at the monthly timetable of prayer (salat).

RUSHI said...

You can view the Islamic prayer timings Dubai UAE of any day, month and fasting. Muslims perform prayers (salat) Fajr, Dhuhr, Asr, Maghrib, Isha Five times in a day.

RUSHI said...

Muslims who lives in Least London, UK and they want to know about Islamic Muslims Namaz times have a look at London prayer times. You can see five salat times in this website.

RUSHI said...

Are you living in Riyadh Saudi Arabia then have a look at the schedule and details of Riyadh prayer times. Get the most accurate Fajr, Zuhr, Asr, Maghrib, Isha namaz times.

Mohammad Azimuddin said...

Can you show with some example about the Dhuhr namaaz timing?