Can you tell me how many minutes before each prayer ends would be suitable to warn a user of a prayer application?

I would like to do this for these salats:


For some of the prayers, I think they end at the following times:

Fajr: Up to sunrise.
Margrib: Until Isha begins.
Isha: Until midnight

If these assumptions are not correct then please let me know.

  • 1
    The end time of each prayer is the beginning time of the following one. How much time a person needs to perform the prayer however is individual. There are recommendations on end time for example the hanbali school of fiqh considers praying 'asr after as sufra (when the sky gets a yellow shade) as qada'. Also read islam.stackexchange.com/questions/32643/…
    – Medi1Saif
    Commented Feb 22, 2018 at 6:37
  • Assalam alaikum wr. wb. Medi1Saif. Thanks for the reply. I will inshAllah incorporate that into my app. Commented Feb 23, 2018 at 9:53
  • 1
    I'm voting to close this question as off-topic because it's a request for opinions on software design. Commented Mar 25, 2018 at 14:45
  • Rebecca, Sorry it seems off topic. It's mostly a question to find out the ending times for salat since I was looking for the cut-off times which was answered for me. I will remove the references to my software development so I do hope it will come back into topic. Commented Mar 26, 2018 at 18:59

2 Answers 2


The criteria for the times (start and end) of each prayer is defined by the following hadith in Sahih Muslim:

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

'Abdullah ibn 'Amr reported: The Messenger of Allah (ﷺ) said: "The time of the noon prayer is when the sun passes the meridian and a man's shadow is the same (length) as his height, (and it lasts) as long as the time for the afternoon prayer has not come; the time for the afternoon prayer is as long as the sun has not become pale; the time of the evening prayer is as long as the twilight has not ended; the time of the night prayer is up to the middle of the average night and the time of the morning prayer is from the appearance of dawn, as long as the sun has not risen; but when the sun rises, refrain from prayer for it rises between the horns of the devil."

Sahih Muslim, Book 5, Hadith 222

As you can see, not all prayers end when the prayer that follows starts. This is the case only for dhuhr prayer.

As for the fajr and 'asr prayer in specific, there is waqt ikhtiyār (preferred time of choice) and waqt darūra (time of necessity). For example, the time of necessity goes from the end of the 'asr prayer time as per the hadith above (the time the sun turns yellow) and extends till the time of maghrib prayers based on the hadith in Sahih Muslim:

عَنْ أَبِي هُرَيْرَةَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ: مَنْ أَدْرَكَ رَكْعَةً مِنَ الصُّبْحِ قَبْلَ أَنْ تَطْلُعَ الشَّمْسُ فَقَدْ أَدْرَكَ الصُّبْحَ وَمَنْ أَدْرَكَ رَكْعَةً مِنَ الْعَصْرِ قَبْلَ أَنْ تَغْرُبَ الشَّمْسُ فَقَدْ أَدْرَكَ الْعَصْرَ

Abu Huraira reported: The Messenger of Allah (ﷺ) said: "He who finds one rak'ah at dawn before the rising of the sun, he, in fact, finds the dawn prayer. and he who finds one rak'ah of the afternoon prayer before sunset, he, in fact, finds the afternoon prayer."

Sahih Muslim, Book 5, Hadith 209

It is worth noting that the Hanafi school is different from the Maliki, Shafi'i, and Hanbali school in the calculation method of the start of 'asr and 'ishā' prayer:

  • 'Asr prayer time:
    • Maliki, Shafi'i, Hanbali, and some Hanafis: start of 'asr prayer time is the end of dhuhr time until the sun turns yellow
    • Rest of Hanafis: 'asr prayer time starts when a man's shadow is twice the length as his height until sunset or start of maghrib prayer time.
  • 'Ishā' prayer time:
    • Maliki, Shafi'i, Hanbali, and some Hanafis: start of 'ishā' prayer time is the setting of the red twilight.
    • Rest of Hanafis: start of 'ishā' prayer time is the setting of the white twilight (which is a few minutes later).

There are libraries of code available online (e.g., PrayersTime Code) that can assist you in your programming endeavor.

  • 1
    Thank you everyone for the informative answers and the edits to clarify the question. :-) Commented Mar 27, 2018 at 19:50

It's up to to the discretion of the mosque committee in charge. When a large number of people are expected, I expect there to be enough time to be given so that people can organise themselves. Contrarywise, when a smaller prayer body is expected we can expect less time.

I've also noted that when the mosque cannot hold the number of people expected, in particular for Eid prayers, they sometimes hold staggered prayers.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .