How are the 5 Islamic prayer (salah/namaz) times calculated?
Islamic prayer times are calculated based on the sunrise and sunset time of the location. As the sunrise and sunset times vary from day to day during the year, the prayer times will also change accordingly. The calculation for the different prayer (salah/namaz) times in the sunni schools are as follows (There are some differences on how Shia schools calculate some of the prayer times)
When is Zuhr prayer time? The time for Zuhr prayer begins after the sun passes its zenith and lasts until the start of the Asr prayers.
When is Asr prayer time? There are two different calculations within the Sunni schools for Asr prayer timings. One is that the Asr prayer starts when the shadow of an object is the same length as the object itself. The second calculation method is that of the Hanafi school, which starts Asr prayer when the shadow of an object is twice its length. The time of Asr lasts till sunset. However, it is highly preferred to perform Asr prayer before the sun becomes yellow (10 to 30 mins before sunset depending on the season of the year).
When is Maghrib prayer time? The Maghrib prayer begins when the sun sets, and lasts until the red light (shafaq-al-ahmar) has left the sky.
When is Isha prayer time?: The Isha prayer starts when the red light is gone from the sky, and lasts till the middle of the night (halfway between sunset and sunrise). However, although not preferred, you are allowed to pray Isha prayer until before the start of Fajr.
When is Fajr prayer time? The time for Fajr prayers begins at true dawn (fajr-al-sadiq) and ends at sunrise.