Skip to main content

Prayer times, part 4: Fajr, Isha and the twilight angles

· 31 min read
Rizki Rakasiwi
Muslimtify maintainer

Part 1 opened with two apps that disagreed about Fajr by six minutes. We now have everything needed to say exactly why, and to reproduce both numbers.

Fajr and Isha use the same formula as sunrise and sunset from part 3. The only thing that changes is the altitude we ask for. Instead of the sun's center sitting 0.833° below the horizon, we ask for 18°, or 20°, or 15°. The code is four lines. The number is the whole story.

This is part 4 of a series

Part 1 covered the sources. Part 2 found the sun. Part 3 computed sunrise, Dhuhr and Maghrib. This part finishes the twilight prayers. Part 5 covers Asr and the shadow. The full series is under the prayer time calculation tag.

The same question, a different altitude​

In part 3, sun_event answered the question "at what time does the sun reach this altitude, before or after noon?" For sunrise we asked for −0.833° before noon. For sunset, −0.833° after noon.

Fajr is the same question with a deeper altitude, before noon. Isha is the same question with a deeper altitude, after noon:

fajr = sun_event(jd, lat, lon, tz, -fajr_angle, before noon)
isha = sun_event(jd, lat, lon, tz, -isha_angle, after noon)

A handful of authorities define Isha differently, as a fixed number of minutes after Maghrib. Umm al-Qura in Makkah uses 90. For those, isha = maghrib + 90 minutes and no angle is involved.

That is the entire change to the code. The rest of this part is about one thing: what number to put in for the angle, and why Indonesia says 20 while North America says 15.

What the sky looks like 18° down​

Astronomers divide the time after sunset into three bands by how far the sun's center has sunk below the horizon.

From 0° to 6° is civil twilight. The sky is bright, you can read a newspaper outside, and only the brightest planets are visible. From 6° to 12° is nautical twilight, named because sailors could still see the horizon to take star sights. The brighter stars are out and the sea is distinguishable from the sky. From 12° to 18° is astronomical twilight. The sky looks dark to a casual glance but a faint glow lingers on the horizon where the sun went down, and the faintest stars are still washed out. At 18° the glow is gone and astronomers call it night.

Dawn runs the same bands in reverse. Somewhere in the deep end of astronomical twilight, as the sun climbs from about 20° to 15° below the horizon, the first horizontal whiteness appears along the eastern horizon. That is the moment the hadith of Samurah describes, and the moment every Fajr angle is trying to pin down.

civil twilightnautical twilightastronomical twilightnighthorizon−3°−6°−9°−12°−15°−18°−21°Fajr anglesFrance 12°ISNA 15°MWL, Karachi 18°Makkah 18.5°Egypt 19.5°Kemenag, JAKIM 20°Isha anglesFrance 12°ISNA 15°MWL 17°Egypt 17.5°Karachi, Kemenag 18°
The twilight gauge: how far the sun's center is below the horizon. Fajr begins when the rising sun reaches the method's angle, Isha when the sinking sun reaches it. The named bands are the astronomers' divisions of twilight.

Which light counts​

Before the true dawn there is an earlier light, and the formula cannot see it, which is worth understanding.

An hour or two before the true dawn, in clear dark skies, a faint cone of light appears standing up from the eastern horizon, leaning along the path the sun will follow. It is sunlight scattered by dust spread through the plane of the solar system, and astronomers call it the zodiacal light. It is the false dawn, al-fajr al-kadhib, "the one that rises vertically". It brightens, then fades, and the sky goes dark again.

The true dawn, al-fajr as-sadiq, is different light with a different cause. It is sunlight scattered by the upper atmosphere, and because the atmosphere is a layer wrapped around the earth, the light lies flat along the horizon and spreads sideways as the sun climbs. Once it appears it never fades, it only grows into day.

eastern horizonFalse dawn, al-fajr al-kadhiba tall faint cone that fades againno legal effect, suhur continueseastern horizonTrue dawn, al-fajr as-sadiqa band along the horizon that only growsFajr begins, the fast begins
The two dawns from the hadith of Samurah in part 1. The false dawn is sunlight scattered by dust in the plane of the solar system, and it points up. The true dawn is sunlight scattered by the upper atmosphere, and it lies flat along the horizon.

Our formula computes one thing: how far the sun is below the horizon. The false dawn does not depend on that in any simple way, because it comes from dust far outside the atmosphere. The true dawn does, closely. So when a method says "Fajr at 18°", it is a claim about the true dawn only. The false dawn is not in the calculation at all, which is exactly what the hadith asks for.

Where each number comes from​

Every authority answered the same question: on a clear night, at what depression of the sun do careful observers first see the true dawn, and last see the evening glow? They got different numbers, and part 1 gave the four reasons they could. Here is how it played out for the methods Muslimtify ships.

MethodFajrIshaWhere the numbers come from
Egyptian General Authority19.5°17.5°One of the oldest national standards, published by Egypt's survey authority and used by al-Azhar. The 17.5° Isha is tied to the disappearance of the red twilight. The origin of the exact figures is not well documented.
Muslim World League18°17°Adopted by the League's fiqh council in the 1970s as a round figure usable worldwide, with 17° for the disappearance of the red twilight.
Karachi18°18°The same Fajr as the League, with 18° for Isha following the Hanafi view that the white twilight must also disappear.
Umm al-Qura, Makkah18.5°90 minThe official Saudi calendar. Fajr was 19° until December 2008, when it moved to 18.5°. Isha is a fixed interval after Maghrib rather than an angle, simpler to publish and never early, and the official calendar uses 120 minutes during Ramadan.
Kemenag, Indonesia20°18°The 20° dawn criterion originates with Saadoeddin Djambek, the Indonesian falak scholar, and is still Kemenag's. In December 2020 Kemenag reaffirmed it, citing dawn observations by its own falak team at Labuan Bajo in 2018 and by Nahdlatul Ulama researchers at Banyuwangi. The same month Muhammadiyah moved its own criterion to 18°, about 8 minutes later.
ISNA, North America15°15°ISNA's long-standing convention. Around 2010 the Fiqh Council of North America discussed moving to 18°, and reports after that disagree on what was adopted, so many North American communities now use 18° or 17.5° while apps still label 15° as ISNA.
UOIF, France12°12°A pragmatic choice by the French federation now called Musulmans de France. At 18° there is no Fajr at all in France for weeks in summer. When and how 12° was adopted is not well documented.

Read down the Fajr column and you see the pattern from part 1. The numbers from 18° to 20° are all observations of the same dawn in different skies. The numbers at 15° and 12° are decisions, made by authorities for their own people, that trade a little of the astronomy for a timetable people in those places can actually keep. Both kinds are legitimate in their place, and the authority of each country settles which applies there.

The Isha column adds the oldest disagreement of all. The hadith says Maghrib lasts "as long as the twilight (shafaq) has not disappeared", and the Companions already differed over whether that means the red glow or the whiter glow that outlasts it. The red fades first. So the authorities that follow the red twilight tend to sit at 17° or 17.5°, and those that follow the Hanafi white twilight at 18°. One degree, roughly four minutes in Jakarta, and it traces back to Ibn Umar and Abu Hanifa.

How much does the angle matter?​

More than you might think, and more the further you are from the equator.

For Jakarta on 17 October 2026, before any precaution or rounding, the seven methods above put Fajr anywhere from 04:12 to 04:45, half an hour apart. Between the two most common choices, 18° and 20°, the gap is 8 minutes. That is the six minutes from part 1's two apps, once you allow for rounding and precaution.

Fajr04:1504:2004:2504:3004:3504:4004:4504:50kemenag 04:12egypt 04:14makkah 04:18mwl, karachi 04:20isna 04:33france 04:45Isha18:3018:3518:4018:4518:5018:5519:0019:0519:1019:1519:20france 18:31isna 18:43mwl 18:52egypt 18:54karachi, kemenag 18:56makkah 19:15
The same sky, seven standards. Jakarta, 17 October 2026, before any precaution or rounding. Half an hour separates the earliest Fajr from the latest, and Isha spans three quarters of an hour because Makkah uses a fixed 90 minutes after sunset.

Move to Istanbul and the same 18° versus 20° gap is 11 minutes, because the sun crosses the twilight band at a slant, as the three panels in part 3 showed. In Oslo it is 17 minutes. In midsummer in London, 18° never arrives at all, because the sun does not get that far below the horizon all night, and that is the problem the French 12° was meant to solve and that part 7 returns to.

The code​

Add this to the file from part 3, in place of its last block. It is a small table of methods and two functions. Nothing in sun_event changes.

METHODS = {
# key fajr angle isha angle isha minutes after maghrib ihtiyat minutes
"isna": dict(fajr=15.0, isha=15.0, interval=0, ihtiyat=0),
"france": dict(fajr=12.0, isha=12.0, interval=0, ihtiyat=0),
"mwl": dict(fajr=18.0, isha=17.0, interval=0, ihtiyat=0),
"karachi": dict(fajr=18.0, isha=18.0, interval=0, ihtiyat=0),
"makkah": dict(fajr=18.5, isha=0.0, interval=90, ihtiyat=0),
"egypt": dict(fajr=19.5, isha=17.5, interval=0, ihtiyat=0),
"kemenag": dict(fajr=20.0, isha=18.0, interval=0, ihtiyat=2),
}

def fajr(jd, latitude, longitude, timezone, method):
return sun_event(jd, latitude, longitude, timezone, -method["fajr"], -1)

def isha(jd, latitude, longitude, timezone, method):
if method["interval"]:
maghrib = sun_event(jd, latitude, longitude, timezone, SUNRISE_ALTITUDE, +1)
return None if maghrib is None else maghrib + method["interval"] / 60
return sun_event(jd, latitude, longitude, timezone, -method["isha"], +1)

def with_ihtiyat(t, method):
return None if t is None else t + method["ihtiyat"] / 60

if __name__ == "__main__":
jd = julian_day(2026, 10, 17)
lat, lon, tz = -6.2088, 106.8456, 7 # Jakarta, WIB
print("method fajr isha (as the timetable prints them)")
for key, m in METHODS.items():
f = with_ihtiyat(fajr(jd, lat, lon, tz, m), m)
i = with_ihtiyat(isha(jd, lat, lon, tz, m), m)
print(f"{key:<9} {hm(f, round_up=True)} {hm(i, round_up=True)}")

The sign on the angle is the one thing people get wrong. sun_event takes an altitude, and "18° below the horizon" is an altitude of −18°. The method table stores the angle as a positive number because that is how every authority writes it, so the two functions negate it on the way in.

Check your work​

Run it. For Jakarta on 17 October 2026 you should see:

method fajr isha (as the timetable prints them)
isna 04:33 18:44
france 04:46 18:32
mwl 04:21 18:52
karachi 04:21 18:56
makkah 04:19 19:16
egypt 04:15 18:54
kemenag 04:15 18:58

Every row is rounded up to the next minute, and the Kemenag row includes its two minutes of ihtiyat, so these are the times a timetable in each country would print for Jakarta. The Kemenag row is what Muslimtify shows by default. Switch the method with muslimtify method and each of the other rows should appear.

Now look at the spread. Egypt at 19.5° and Kemenag at 20° print the same Fajr, because the half degree between them is worth about two minutes in Jakarta, the same as Kemenag's precaution, and the two cancel out. ISNA at 15° is eighteen minutes later. If you have ever wondered why your phone and the mosque disagree about Fajr by a quarter of an hour, the answer is almost always that they are using two rows of this table.

Finally, the sky test. Fajr is harder to see than sunset, but it can be done. On a clear morning away from city lights, face east about forty minutes before sunrise. If you can catch the first flat band of whiteness appearing on the horizon and note the time, you have done what Saadoeddin Djambek did when he proposed 20°. Compare it with the 18° and 20° rows and you will have an opinion of your own about which is right for your sky. It is also exactly what Kemenag's team did at Labuan Bajo in 2018 before reaffirming 20°, and what Muhammadiyah's team did before choosing 18°.

What to carry into part 5​

Fajr and Isha are the horizon question from part 3 asked with a deeper altitude, and the altitude is a measurement of twilight that different authorities made in different skies, with a few choosing a shallower angle for practical reasons. The one degree between 17° and 18° for Isha goes back to the Companions and the colour of the evening glow. The method you pick is not a technical setting. It is the authority whose observation you follow.

Part 5 is Asr, and it is different from everything so far. Asr does not depend on the sun being below the horizon at all. It depends on the length of a shadow, the first instrument in the series and the last one we need. It is also the one prayer whose time is set by your madhhab rather than by your country.