
     		In The Name Of Allah, The Compassionate, The All-Merciful
     	"Establish regular prayers at the Sun's decline till the darkness of the night, 
and the recital of the Quran in the morning prayer; for the recital of the dawn is Witnessed. [17:78]"





				Salat Times 1.3


Contents

  1. What is Salat Times?
  2. Why Yet Another Islamic Prayer Time Calculator?
  3. Notes About Islamic Prayer Times
  4. Notes About Accuracy 
  5. Before Using Salat Times 1.3
  6. Using Salat Times 1.3
  7. Hidden Features
  8. Acknowledgements



1. What is Salat Times?

Salat Times is a DOS program for calculating Islamic Prayer Times for any location on the globe and for the time interval from year -2000 BC to 6000 AD. The program also calculates the instance of new moon, rise, transit and set times for the moon. In addition it provides Qibla direction and calculates the distance to Mecca.

2. Why Yet Another Islamic Prayer Time Calculator?

 Why not? I hope every Muslim will make his own prayer time calculator.
However, the reasons why I made this program are as follows:

* Though, many good Islamic payer time calculators are available, most of them provide erroneous times for high latitudes (e.g. for places in north of Sweden). The reason for that is the mathematical model used in most of these programs is based on pure spherical mathematics formulae. Such formulae diverge at high latitudes. In addition, no information is provided about the possible error margin and results are not corrected for errors. Salat Times use advanced theory to calculate planetary co-ordinates and demands high accuracy on obtained result. If this accuracy is not achieved, the result is marked not valid. Valid results are always corrected for possible errors

* In all other programs, the calculation is done using the defined/entered values of latitude and longitude. If we assume the given co-ordinates are for the center of a city, then what would be the result for people living, say 20 Km away from the center? This is not possible to calculate by other programs (unless co-ordinates of the place in question are found). Salat Times, provides an option to calculate prayer times for an entire circle of radius=distance from the center of any location.

* All other programs provide one angle to determine Imsak/Fajr/Isha times. If one needs to define 2 angles (one for Imsak/Isha time and one for Fajr time) then it is not possible. Salat Times provides such facility.

* Most other programs use mathematical rounding when certain result is rounded. Salat Times rounds always the result upward. See chapter  "Before Using Salat Times".

* Most other programs calculate prayer times according to certain school(s) of Law (Fiqh). Salat Times does the calculations according to all 5 schools of law.
 
3. Notes About Islamic Prayer Times

The definition of Islamic Prayer Times used in this program is as follows:

* Fajr time: All schools agree on same definition, which is when true dawn occurred.

* Duhr time: Duhr time starts when the eastern limb of the sun passes the local meridian. Zawal time (or noontime) is the time when the center of the sun is exactly on the local meridian. Between Zawal time and Duhr time no prayer is allowed to be performed.

* Asr time: According to Jafari, Asr time is the time following Duhr time, According to Shafi'i and Maliki it is the time when the shadow of an object exceeds its height, plus shadow of object at noontime. The Hanafi and Hanbali define it as when the length of shadow exceeds double the height of the object, plus shadow of the object at noon.

* Magrib time: Is the time of sunset which is when the sun completely below the horizon.

* Isha time: The Jafari define the time of Isha as the time after Magrib prayer. All other schools define it as when the radish after glow on the western horizon vanishes.

As there is disagreement between the schools of law about the definition of prayer times, there is also disagreement within the same school of law. One such example is Maghrib time. Some people believe Maghrib time is the time when eastern twilight vanishes while others declare it as the time of sunset. Any prayer time calculating program can not satisfy all the ideas and interpretations. Therefore, the definition satisfying the majority of Muslims is chosen. In addition, options are provided to the users to adjust the program to achieve desired result. In the case of Maghrib time, an option is been provided to add minutes to the calculated Maghrib time. Further, some of the schools define 2 times for the same prayer (e.g. Maliki). The first one is for ordinary circumstances and the second for exigencies. The program only calculates ordinary times. 
Also, Fajr and Isha times depend on different conditions (e.g. meteorological) and can not be calculated precisely. This is well documented in various books and will not be explained here. However, the program enables the user to choose 2 angles separately. One is to be used for Fajr time and the other is to be used for Imsak and Isha times. These angles are provided, as some people require "Ihtiat" when determining prayer times. In the concept of prayer times, Ihtiat means when one is uncertain about whether certain prayer time occurred or not then he has to wait as much as possible until certainty is obtained. In the concept of fasting Ihtiat means if one is uncertain whether Fajr time occurred or not then he has to start the fasting as soon as possible. That's why 2 angles are provided. If one wishes to use only one angle then both angles should be assigned the same value.

Also, at high latitudes (close to one of the arctic circles), during certain time of the year, some/all prayer times are not possible to calculate (either the sun is always below or over the horizon). Salat Times will indicate this for you and you have to consult your school of law for the rules to follow.


4. Notes About Accuracy 

In order to get correct prayer times; correct input data should to be provided. Correct Fajr and Imsak-Isha angles have to be chosen. Correct location co-ordinates, zonetime, daylight saving time data and observer height have to be provided. Once all these values are correctly chosen the error margin is a minimum.

The mathematics used for calculating prayer times is very accurate (in fact you can not get better on PCs). The major source of errors in obtained result is the given latitude/ and longitude values. The data included in the location database is obtained from military source and supposed to be accurate. However, as not all military rackets find their way to specified targets not all co-ordinates are correct. Before using the program, take your time and find/check the co-ordinates for your place and change/add them when needed. You need to do that only once and it will be stored in the database permanently. 

A second source of error with much less effect is the value of refraction. The program uses a predefined value of 34 minutes of arc for refraction. This value is accepted by majority of astronomers and is valid for most places on earth. In places close to one of the arctic circles, a change in meteorological conditions could shift the result by up to few minutes. Inside the arctic circles such change could shift the result by many minutes. However, if your place is not close to one of the arctic circles, then the chosen value of refraction is good enough for your place. Otherwise, please refer to the section "Hidden Features" for details on how to change the value of refraction.

In all other calculations the error margin is negligible. The program works as follows:
 First the position of the sun is calculated using VSOP87 theory. The authors of this theory guarantee the error in co-ordinates for the sun never exceed 250 millisecond of time (in fact the error is less than 0.25 second in the longitude and less than 0.08 second in latitude of the sun). Then the co-ordinates of the Sun are corrected and converted to apparent equatorial co-ordinates. With exception to rounding error, the error so far does not exceed 1 second in all steps. Iteration is then made to find prayer times with compensation for observer height, refraction, parallax and semidiameter.  

The iteration process is concluded when the error in the obtained result is less than 1 second. If such accuracy can not bee achieved then the result is marked "NotValid". When valid result is obtained, the result is corrected by 2 seconds to compensate for errors in previous steps. Imsak and rise times are corrected by subtracting 2 seconds of time from obtained result. All other prayer times are corrected by adding the same amount of time. It should be mentioned here, Salat Times does not claim an accuracy of 2 seconds! In fact the accuracy depends on (among other things) the actual machine it is running on and the availability of co-processor. However, rounding errors and errors related to the actual machine are hard to predict and thus can not be compensated. I do not suggest adding minutes/seconds to the calculated prayer times and there is no need to do that. If you use prayer times given in minutes then you are more than safe! Anyhow, if one is insisting on adding more time to the calculated times then please refer to the section "Hidden Options" for further details.  

As the main goal for this program is to calculate prayer times, less demand has been made on moon data. However, data for the moon is reasonable for years not too far from year 2000. For more distant years, the error in result can be up to several minutes. In addition, due to nearness of the moon and the eccentricity of its orbit, rise, transit and set times for the moon could be messy (the same applies for the sun at high latitudes). For example you may get moonrise time at 00:12 and then moonset at 00:05! This is not a fault in the program. Salat times calculate rise, transit and set time during 24 hours of a day. In the example above, the moonset time provided is really for the moon from previous day! 

The Qibla direction is based on great circle bearing. However geographic latitude and longitude are converted to geocentric before use. The distance to Mecca is very accurate and can be off at most few hundred meters.

It should be noted here that providing prayer times (and even worse moon data) in seconds does not make any sense (due for. ex. refraction) and should not be used. This option was included to give people an idea about the differences in prayer times when different distances and angles are used.

5. Before Using Salat Times 1.3

Before using Salat times be aware the following:

* Salat Times always work on double precision. When rounding is needed the result is rounded upward (i.e. 1.11 will be 1.2). This method was chosen to make sure no prayer time would be given early than it should (even with very small fraction of second error!).

* Whenever the user is requested for input, pressing Escape key will terminated the current process and bring you back to the previous menu.

* When you are requested to provide input and there is a default value shown to you, then you can press Enter to chose the default value or just enter new data. If no default value exist then you have to type new data (or you can press Escape to terminate the process).

* Sometimes you may get the symbols < or > in the end of given times. The symbol < indicates the time is related to previous day and the symbol > indicates the time is related to next day. For example, if you get the time as 12:35<, then it means the time is 12:35 in previous day.

* If instead of times you get NotValid, AlwAbove or AlwBelow then this means no time can be calculated. The text NotValid indicates precise time can not be calculated (due for ex. The sun or moon altitude is reaching maximum or minimum or demanded accuracy can not be obtained). AlwAbove indicates the sun/moon is always above the horizon while AlwBelow indicates the sun or moon is always below the horizon.  

* All times provided by Salat Times are local times to the location in question. The data defined in location database is used (i.e. zone and DST are added).

* In the included location database, DST (Daylight Saving Time) is turned off for all locations. The reason is, there is no unified rule to follow and countries are continuously canceling (like China) DST while others are joining the club. In addition, even in one country all states are not using DST nor all counties within the same state are using DST! Thus, if your location uses DST then use the option "Change Location" to provide start and end times for DST. 

* In the included database the height of zero is given to all locations. Because providing certain value for height would perhaps not be valid for all places within the location in question. For example, the city of Tehran is on the side of a mountain. People living in the south part of the city will have sea level height while people living in the north part of the city will have the height of 1850 meters!

* Salat Times does not have "Print" function yet. If you need to print any result then Save the result into a text file and then print the file using available program. Otherwise you can use DOS redirecting to direct the result to the printer.

  4. Using Salat Times 1.3

SalatTimes is text-dialogue-oriented program. A user can choose operations from the shown menu and he will be instructed to provide additional data when need. Here, I only include few explanations to some of the data or format used.

Co-ordinates : The co-ordinates of any place can be given in the following format:
Latitude = dd mm ss h: d stands for degree, m for minutes of degree, s for seconds of degree and h for hemisphere (N or S). If precision in minutes is chosen then ss is dropped.
Longitude = ddd mm ss h: As above, however, h can be E or W. 

Date: Any calendar date between year -2000 BC and 6000 AD can be given. However, for people with historical interest, there is a year zero! Thus, when finding data for negative years then add 1 to get correct year. Also, calendar dates down to year 1582 should be given in Gregorian calendar. All other years are given in Julian calendar.

Distance: The value of distance is used to calculate prayer times for a circle of radius equal to distance. The center of the circle is the given co-ordinates of the location in question. The value of distance is given in kilometers and the acceptable range is from 0 to 100 Km. if certain value is chosen it will be applicable to all locations. Please note that if your place is not close to one of the arctic circles then you do not need to find exact distance for your place in order to get correct prayer times. An error of few kilometers in the value of distance will not effect the result. For places close to one of the arctic circles, you should use this option with care. A fault of few kilometers in the value of distance could shift the result by several minutes. For locations close to one of pools the distance parameter should be set zero and the co-ordinates for location in question should be used.

Height: The value of height is given in meters and is indicating the height of the location in question ASL (Above Sea Level). 

Help: The help function provided by Salat Times is very simple. Basically, it uses DOS "more" command to view the file Stime.txt. You can press f to get next page, b to get previous page and q to quit.

Imsak-Isha and Fajr angle: Imsak-Isha and Fajr angle indicates how many degrees below the horizon the sun has to reach in order to declare Imsak-Isha or Fajr time occurred. The acceptable range for Imsak-Isha angle is between -20 and 0 degrees (even if an angle bigger than -6 will not make any sense!). For Fajr angle the acceptable range is between the value of Imsak-Isha angle and 0 degrees. In most countries people are using single angle both for Imsak-Isha and Fajr. However, different countries (or school of law) are using different values. For example people in US use -15 while Egypt is using -19. I believe using one angle value will favorite one prayer (or Imsak) than the other. If for example the value -20 is chosen then you will have early Fajr and late Isha. I am not sure if such Fajr will fit into the description of True Dawn (too dark even to be the tail of the Fox or False Dawn!). On the other hand if the value of -10 is chosen then you will have late Fajr and early Isha times. Such Fajr will be too bright for Imsak and Isha times. Anyhow, as 2 angles are provided in this program, the default configuration (and the recommended) is -16 for Imsak-Isha angle and -13 for Fajr angle. 

Location Name: Location name is any sequence of printable ASCII characters. However, a maximum of 14 characters is valid for country and city names.

Minutes Added To Maghrib Time: You can add 0 to 20 minutes to the calculated Maghrib time. This feature is provided due to request from people not accepting sunset time as the time of Maghrib.

New Moon: The instance of new moon (in Arabic Mawlid Alhilal) is used to find approximate start times for Islamic calendar month. Please, note that the instant of new moon does not indicate the start of Islamic month. It only indicates next Islamic month will not start before that time and it will start within two days after the given time.

Precision: Salat times can operate on 2 different precision modes. One is in minutes and the other is in seconds. Both modes effect only the input and output routines and have no effect on the calculations. If the mode minutes is chosen, then all times and co-ordinates will be given in minutes. If seconds is chosen, then all times and co-ordinates will be given in seconds. Please observe that the chosen value will effect the format of co-ordinates when entered into the program (i.e. if seconds is chosen and you are in the process of adding a location then you have to type the co-ordinates for the location in question is seconds of degree).

Qibla Direction: Qibla direction is given in degrees and fractions of degrees, clockwise from the North. If for example, the value of 49.17 is obtained then you have to face the North and then turn to the right 49.17 degrees to face the Qibla.

4. Hidden Features

Salat Times has few hidden switches that manipulate calculating parameters. These switches are included due to request from some people. Unless you know what you are doing, I do not recommend using these. They are needed only in rare cases and therefore they are not supported. Use of these switches follows DOS syntax; i.e. start the program with list of switches and corresponding values. For example, to change the value of refraction to 40 start Salat Times with the following line:
Stime.exe /r 40
Following options are available:
/c	: This switch defines the number of corrected seconds.  Corrected seconds are the seconds added or subtracted from prayer times (all of them) to compensate for errors. The program has default of 2 seconds. Please refer to the section "Notes about accuracy" for further details.

/f	: This switch defines the maximum acceptable error in the iteration process in seconds of time. The program has default value of 1 seconds of time. If your computer has an old processor, the program is too slow or you are getting too many "NotValid", try to increase this value. Please note that increasing this value has to be compensated using the switch /c. 

/r	: This switch changes the default value of refraction. The value of refraction is given in minutes of arc. Salat Times has default value of 34 minutes of arc. It should be mentioned here that this value of refraction is only used when calculating rise and set times. When calculating other altitudes different formula is used.


7. Acknowledgements

I am grateful to all support, advice and help I received from many people. Special thanks to the people who helped me with testing this programs and reported eventual faults at early stage. 

Wa-Ssalam
Ali Alhadad, Friday 6, Safar 1418 AH
                    June 1, 1998 AD







