Skip to main content

Prayer times, part 1: what the Quran and Sunnah actually say

· 19 min read
Rizki Rakasiwi
Muslimtify maintainer

Open two prayer apps on the same phone, in the same city, on the same day, and there is a fair chance they will not agree on Fajr. One says 04:21, the other 04:27. Both are made by Muslims who care about getting it right. So who is wrong?

Usually nobody. To see why, you have to go back to where prayer times come from. Not from an app, and not from an astronomer, but from the Quran, from the Prophet ﷺ, and from the generations who learned from him. That is what this first part is about. There is no code in it, and no math. Just the texts, and what they ask us to look at in the sky.

This is part 1 of a series

The series explains how prayer times are defined and how a computer works them out. Later parts cover the sun's position, each prayer's formula, why Indonesia, Turkey and Saudi Arabia publish different tables, and a complete implementation you can run yourself. Each part stands on its own, but they read best in order.

The Quran gives anchors, not clock times​

The Quran is clear that prayer has fixed times:

إِنَّ الصَّلَاةَ كَانَتْ عَلَى الْمُؤْمِنِينَ كِتَابًا مَّوْقُوتًا

"Indeed, prayer has been decreed upon the believers at specified times." (An-Nisa 4:103)

But when the Quran describes those times, it never says an hour or a minute. It points at the sun and the sky:

أَقِمِ الصَّلَاةَ لِدُلُوكِ الشَّمْسِ إِلَىٰ غَسَقِ اللَّيْلِ وَقُرْآنَ الْفَجْرِ ۖ إِنَّ قُرْآنَ الْفَجْرِ كَانَ مَشْهُودًا

"Establish prayer from the declining of the sun until the darkness of the night, and the recitation of dawn. Indeed, the recitation of dawn is ever witnessed." (Al-Isra 17:78)

The commentators read this one verse as a map of all five prayers. Duluk ash-shams, the sun beginning to decline from its highest point, is Dhuhr, and the stretch from there to ghasaq al-layl, the full darkness of night, covers Dhuhr, Asr, Maghrib and Isha. Quran al-fajr, the recitation at dawn, is Fajr.

Other verses add detail to the same picture:

وَأَقِمِ الصَّلَاةَ طَرَفَيِ النَّهَارِ وَزُلَفًا مِّنَ اللَّيْلِ

"And establish prayer at the two ends of the day and in the early hours of the night." (Hud 11:114)

وَسَبِّحْ بِحَمْدِ رَبِّكَ قَبْلَ طُلُوعِ الشَّمْسِ وَقَبْلَ غُرُوبِهَا ۖ وَمِنْ آنَاءِ اللَّيْلِ فَسَبِّحْ وَأَطْرَافَ النَّهَارِ

"And glorify your Lord with praise before the rising of the sun and before its setting, and during the hours of the night, and at the ends of the day." (Ta-Ha 20:130)

فَسُبْحَانَ اللَّهِ حِينَ تُمْسُونَ وَحِينَ تُصْبِحُونَ ۝ وَلَهُ الْحَمْدُ فِي السَّمَاوَاتِ وَالْأَرْضِ وَعَشِيًّا وَحِينَ تُظْهِرُونَ

"So glorify Allah when you reach the evening and when you reach the morning. To Him is praise in the heavens and the earth, and in the late afternoon and when you are at noon." (Ar-Rum 30:17-18)

And for the start of Fajr, the verse about the fast gives the most physical description of all:

وَكُلُوا وَاشْرَبُوا حَتَّىٰ يَتَبَيَّنَ لَكُمُ الْخَيْطُ الْأَبْيَضُ مِنَ الْخَيْطِ الْأَسْوَدِ مِنَ الْفَجْرِ

"And eat and drink until the white thread of dawn becomes distinct to you from the black thread." (Al-Baqarah 2:187)

Notice what the Quran is doing. It tells us what to watch for: the sun leaving its peak, the sun setting, the dark of night, a thin white line on the horizon. It does not tell us the minute. That is the whole reason a prayer time can be calculated at all. There is a physical event to find, and the sun follows laws we can write down.

The Prophet ﷺ gave the windows​

The Quran gives the anchors. The Sunnah gives each prayer a beginning and an end.

The single most useful hadith for anyone who wants to understand prayer times is narrated by Abdullah ibn Amr رضي الله عنهما, in Sahih Muslim:

وَقْتُ الظُّهْرِ إِذَا زَالَتِ الشَّمْسُ وَكَانَ ظِلُّ الرَّجُلِ كَطُولِهِ مَا لَمْ يَحْضُرِ الْعَصْرُ، وَوَقْتُ الْعَصْرِ مَا لَمْ تَصْفَرَّ الشَّمْسُ، وَوَقْتُ صَلَاةِ الْمَغْرِبِ مَا لَمْ يَغِبِ الشَّفَقُ، وَوَقْتُ صَلَاةِ الْعِشَاءِ إِلَىٰ نِصْفِ اللَّيْلِ الْأَوْسَطِ، وَوَقْتُ صَلَاةِ الصُّبْحِ مِنْ طُلُوعِ الْفَجْرِ مَا لَمْ تَطْلُعِ الشَّمْسُ

"The time of Dhuhr is when the sun has declined and a man's shadow is the length of his height, for as long as Asr has not come. The time of Asr lasts as long as the sun has not turned yellow. The time of Maghrib lasts as long as the twilight has not disappeared. The time of Isha extends to the middle of the night. And the time of Subh is from the appearance of dawn for as long as the sun has not risen." (Sahih Muslim 612)

Read it slowly, because every number in a prayer app comes from a word in this hadith:

The Prophet ﷺ saidThe event in the skyWhat the app computes
"when the sun has declined" (zalat ash-shams)the sun passes its highest pointDhuhr
"a man's shadow is the length of his height"shadow grows back to the object's lengthAsr
"as long as the sun has not turned yellow"late afternoonend of Asr
"as long as the twilight (shafaq) has not disappeared"the glow after sunset fadesMaghrib and the start of Isha
"to the middle of the night"midpoint between sunset and dawnend of Isha
"from the appearance of dawn" (tulu' al-fajr)the first true light before sunriseFajr
"as long as the sun has not risen"sunriseend of Fajr
horizoneastwestFajrthe white thread spreadsSunriseend of FajrDhuhrthe sun has declinedAsra shadow equals its objectMaghribthe sun has setIshathe twilight has disappearedbelow the horizon the sun is out of sight, but its depth still sets the light in the sky
Each prayer begins at a point on the sun's daily arc. The phrases are from the hadith of Abdullah ibn Amr. Fajr and Isha begin while the sun is below the horizon, which is why they need an angle rather than a shadow.

The second great source is the hadith of Jibril عليه السلام, narrated by Ibn Abbas رضي الله عنهما. Jibril led the Prophet ﷺ in prayer at the Kaaba on two consecutive days, once at the earliest moment of each prayer and once at the latest, and then said:

يَا مُحَمَّدُ، هَٰذَا وَقْتُ الْأَنْبِيَاءِ مِنْ قَبْلِكَ، وَالْوَقْتُ مَا بَيْنَ هَٰذَيْنِ الْوَقْتَيْنِ

"O Muhammad, this is the time of the prophets before you, and the time is between these two times." (Sunan Abi Dawud 393, Jami' at-Tirmidhi 149)

Two details from this hadith will matter later. On the first day Jibril prayed Asr "when the shadow of a thing was equal to it", and on the second day "when the shadow of a thing was twice it". And on both days he prayed Fajr: once "when dawn broke" and once "when it had become quite bright". Keep those in mind. They are the oldest roots of two disagreements that still shape timetables today.

Which dawn?​

The word fajr needs care, because there are two dawns. The Prophet ﷺ explained the difference to the Companions in the context of suhur:

لَا يَغُرَّنَّكُمْ مِنْ سَحُورِكُمْ أَذَانُ بِلَالٍ وَلَا بَيَاضُ الْأُفُقِ الْمُسْتَطِيلُ هَٰكَذَا حَتَّىٰ يَسْتَطِيرَ

"Do not let the adhan of Bilal deceive you about your suhur, nor the whiteness of the horizon that rises vertically like this, until it spreads horizontally." (Sahih Muslim 1094)

The first light, a tall pale column that appears and then fades, is al-fajr al-kadhib, the false dawn. It has no legal effect. The true dawn, al-fajr as-sadiq, is the white light that spreads sideways along the horizon and only grows. That is the "white thread" of Al-Baqarah 2:187, and it is the moment Fajr begins. Bilal's night adhan was a reminder for the sleepers, and Ibn Umm Maktum's adhan marked the real dawn:

إِنَّ بِلَالًا يُؤَذِّنُ بِلَيْلٍ، فَكُلُوا وَاشْرَبُوا حَتَّىٰ يُؤَذِّنَ ابْنُ أُمِّ مَكْتُومٍ

"Bilal gives the adhan at night, so eat and drink until Ibn Umm Maktum gives the adhan." (Sahih al-Bukhari 617)

When a prayer app says Fajr is at 18° or 20° below the horizon, it is making a claim about when this horizontal light becomes visible. Hold that thought for part 4.

The Companions turned observation into practice​

The generation that prayed behind the Prophet ﷺ did not have tables. They had the sky, a stick, and what they had seen him do.

The stick matters more than it sounds. Plant a straight stick in the ground and its shadow is a clock. The shadow is shortest when the sun is at its peak, and the moment it starts to grow again is zawal, the start of Dhuhr. Mark the length of the shortest shadow, and when the shadow has grown by the stick's own height, Asr has come. Every muwaqqit for the next thousand years, and every line of code in part 5, is refining this stick.

When the Muslim state grew beyond Madinah, Umar ibn al-Khattab رضي الله عنه wrote to his governors describing when each prayer should be prayed, so that the far provinces would pray as Madinah prayed. Malik records the letter in the Muwatta. This is the first time a Muslim authority set a common standard for prayer times across different lands, and it is the precedent behind every national timetable today.

The Companions also disagreed, and their disagreements were honest readings of the same words. The clearest example is shafaq, the twilight whose disappearance ends Maghrib and begins Isha. After sunset the western sky first glows red, and when the red fades a whiter glow lingers a while longer. Ibn Umar رضي الله عنهما held that shafaq is the redness. Others held it to be the whiteness that follows. Red twilight disappears earlier than white, so the two readings put Isha some minutes apart. When you later see one country use 17° for Isha and another use 18°, this is where the difference was born.

The Tabi'in and their students wrote it down​

The scholars of the next two generations, the Tabi'in and the Tabi' at-Tabi'in, inherited these observations and turned them into fiqh. The four imams whose schools most Muslims follow today, Abu Hanifa, Malik, ash-Shafi'i and Ahmad ibn Hanbal, all lived in this period.

Most of what they wrote about prayer times agrees, because the hadith of Abdullah ibn Amr is explicit. The differences are few, and each one goes back to a text:

For Asr, Abu Hanifa took the second day of the hadith of Jibril literally. Asr begins when the shadow of an object is twice its height. Malik, ash-Shafi'i and Ahmad took the first day and the hadith of Abdullah ibn Amr: Asr begins when the shadow equals the height. In Muslimtify this is the madzhab setting, and it is the one part of the timetable that is not tied to any country. For shafaq, Abu Hanifa, in one of the two reports from him, followed the view that shafaq is the white twilight, so Isha begins later. The other three imams followed the red twilight. For Fajr, ash-Shafi'i and Malik preferred praying Fajr in ghalas, the early darkness, following Aisha رضي الله عنها who described women leaving the Prophet's mosque wrapped in their cloaks and unrecognizable in the dark. Abu Hanifa preferred isfar, a little later when the light had spread, following the hadith "Pray Fajr when it brightens, for that is greater in reward". (Jami' at-Tirmidhi 154) This is a preference about when to pray within the window, not about when the window starts, but it shows how early the question of "how much light is dawn?" was already alive.

By the end of this period, every prayer had a legal definition in words: the sun declines, a shadow reaches a length, the sun sets, a colored glow disappears, a white line spreads along the horizon. What nobody had yet was a way to turn those words into a number for a given city on a given date. That came next, from the astronomers of Baghdad, Cairo and Damascus, and it is where part 2 begins.

Why the same texts give different timetables​

Now back to the two apps that disagreed about Fajr. If the definitions come from one hadith, how can Indonesia, Turkey, Egypt and Saudi Arabia each publish a different table? The answer has four parts, and every one of them is itself grounded in the sources.

The texts describe something you have to see​

Al-Baqarah 2:187 says "until the white thread becomes distinct to you". The hadith of Samurah describes a light that "spreads". These are instructions to observe, and observation depends on where the observer stands. Dawn in the dry air of the Hijaz does not look like dawn in the humid air of Java. Altitude, haze, dust, moonlight and city lights all change how deep the sun must be below the horizon before the first horizontal light can be seen. Egyptian observers in the nineteenth century settled on 19.5°. Indonesian observers settled on 20°. Muslim World League scholars settled on 18°. Each number is an honest answer to the question the Quran asked. They differ because the sky differs.

The first generations already read the words differently​

Red or white shafaq. One shadow or two for Asr. Ghalas or isfar for Fajr. None of these is a modern invention. A country whose scholars follow the Hanafi school will set Isha later than a country that follows the Shafi'i school, and both are standing on the reading of an imam who learned from the Tabi'in. A table is not wrong for following a different legitimate reading.

Precaution is itself a Sunnah​

The Prophet ﷺ said:

دَعْ مَا يَرِيبُكَ إِلَىٰ مَا لَا يَرِيبُكَ

"Leave what makes you doubt for what does not make you doubt." (Jami' at-Tirmidhi 2518)

Prayer times are a place where this is applied every day. Praying Dhuhr a minute before the sun has left its peak would make the prayer invalid, and the Prophet ﷺ forbade praying at that moment:

ثَلَاثُ سَاعَاتٍ كَانَ رَسُولُ اللَّهِ ﷺ يَنْهَانَا أَنْ نُصَلِّيَ فِيهِنَّ: حِينَ تَطْلُعُ الشَّمْسُ بَازِغَةً حَتَّىٰ تَرْتَفِعَ، وَحِينَ يَقُومُ قَائِمُ الظَّهِيرَةِ حَتَّىٰ تَمِيلَ الشَّمْسُ، وَحِينَ تَضَيَّفُ الشَّمْسُ لِلْغُرُوبِ حَتَّىٰ تَغْرُبَ

"There are three times at which the Messenger of Allah ﷺ forbade us to pray: when the sun rises until it is well up, when it stands at its zenith until it declines, and when it leans toward setting until it has set." (Sahih Muslim 831)

So authorities add a safety margin. Indonesia's Kemenag adds two minutes to every prayer and calls it ihtiyat, precaution. Turkey's Diyanet adds a larger temkin. Umm al-Qura in Makkah defines Isha as a fixed ninety minutes after Maghrib rather than an angle, which is simpler for the public and never early. These margins are a reason tables differ, and they are a direct application of the hadith above.

Authority settles what ijtihad leaves open​

يَا أَيُّهَا الَّذِينَ آمَنُوا أَطِيعُوا اللَّهَ وَأَطِيعُوا الرَّسُولَ وَأُولِي الْأَمْرِ مِنكُمْ

"O you who believe, obey Allah and obey the Messenger and those in authority among you." (An-Nisa 4:59)

When a question has more than one legitimate answer, the scholars of fiqh hold that the ruling of the authority removes the disagreement for the people under it. Umar's letter to his governors was exactly this. Today the same role is played by Kemenag in Indonesia, JAKIM in Malaysia, Diyanet in Turkey, the Egyptian General Authority of Survey, and the rest of the twenty-one standards Muslimtify ships. A Muslim in Jakarta follows the Kemenag table not because 20° is the only defensible angle, but because that is what the authority responsible for Indonesian Muslims has adopted, after its own observation and ijtihad.

This is why Muslimtify asks you to pick a calculation method instead of guessing one, and why it defaults to Kemenag: it is the standard of the country its author prays in. Picking the method of your own country is not a technical setting. It is choosing which authority's ijtihad you follow.

What to carry into part 2​

Every prayer time starts as a word in a hadith. The words name events in the sky. The events can be seen with the eye, and because the sun is predictable, they can also be computed. Where the texts leave room, the first generations already read them more than one way, the scholars of each land added their own precaution, and the authority of each country chose one answer for its people.

In part 2 we leave the texts and go outside. We will work out where the sun is on any day of the year for any place on earth, which is the one piece of astronomy everything else in this series depends on. Bring a stick.