PHP Classes

Jazak ALLAH Khair

Recommend this page to a friend!

      Salat  >  All threads  >  Jazak ALLAH Khair  >  (Un) Subscribe thread alerts  
Subject:Jazak ALLAH Khair
Summary:a problem
Author:Abu Yusuf
Date:2007-10-22 16:34:26
Update:2008-07-02 13:51:41

  1. Jazak ALLAH Khair   Reply   Report abuse  
Abu Yusuf - 2007-10-22 16:34:26
Jazak ALLAH Khair for that important class ..

i've a problem about the "zone" option

i found only three values avaliable in the menu : 0 , 1 , 2 , 3

And, i can't get what is the meaning of that ..

in egypt we've time zone of GMT + 2

When i chose value : 2

i got wrong times .. So Can you help me ?

  2. Re: Jazak ALLAH Khair   Reply   Report abuse  
Khaled Al-Shamaa - 2007-10-23 06:01:29 - In reply to message 1 from Abu Yusuf
Dear Abu Yusuf,

Calculation based on school you follow (‘Hanafi’ or ‘Shafi’ which is the default value), also there are some other settings you may need to change depends on your city high (we ignore it in class example and calculate for see level), those values are: sun raise arc (default value is -0.833333) as well as Isha and Fajr arc (default value is -18).

Any way, you are able to set new values using setConf method, for example you check first configure calculation on Hanafi school using this command (before calling getPrayTime method):


For more information on how to calculate these times please visit this URL (I refer to it also in the class file comment): ...

Note: Yes zone refer to GMT difference time :o)

Best regards,

  3. Re: Jazak ALLAH Khair   Reply   Report abuse  
FREDERIC - 2007-10-31 12:26:54 - In reply to message 2 from Khaled Al-Shamaa
I tried changing setting for Malaysia but it doesn't return a good time.

  4. Re: Jazak ALLAH Khair   Reply   Report abuse  
Khaled Al-Shamaa - 2007-11-01 10:04:56 - In reply to message 3 from FREDERIC
Dear Friend,

Please be more specific and tell me to which city you calculate and what is the real Salat time in that place and what Salat class give you.

I could not help you if your talk keep as general as that!

Best regards,

  5. Re: Jazak ALLAH Khair   Reply   Report abuse  
FREDERIC - 2007-11-02 04:21:28 - In reply to message 4 from Khaled Al-Shamaa
Dear Jazak ALLAH Khair,
First of all thanks for this script.
Sorry to not have been more precise with my question.
I want to use the script for malaysia :
different cities like Kuala Lumpur
eg :
In location file :
public function setConf($sch='Shafi', $sunriseArc=-0.833333, $ishaArc=-20, $fajrArc=-18){
It's should be 19.5 --- 17.5 but I found website displaying prayer with this setting 20 -- 18

School is Shafi in Malaysia.
Should work with $sunriseArc=-0.833333, but I cannot find the sunrise arch for Malaysia....

My current top script :
class Salat{
private $year = 1975; // السنة
private $month = 8; // الشهر
private $day = 2; // اليوم
private $zone = 2; // فرق التوقيت العالمى
private $long = 29.371; // خط الطول الجغرافى للمكان
private $lat = 47.988; // خط العرض الجغرافى
private $AB2 = -0.833333;// زاوية الشروق والغروب
private $AG2 = -18; // زاوية العشاء
private $AJ2 = -18; // زاوية الفجر
private $school = 'Shafi'; // المذهب

public function setDate($d=2, $m=8, $y=1975){
$this->year = $y;
$this->month = $m;
$this->day = $d;

public function setLocation($l1=29.371, $l2=47.988, $z=2){
$this->long = $l1;
$this->lat = $l2;
$this->zone = $z;

public function setConf($sch='Shafi', $sunriseArc=-0.833333, $ishaArc=-20, $fajrArc=-18){
$this->school = $sch;
$this->AB2 = $sunriseArc;
$this->AG2 = $ishaArc;
$this->AJ2 = $fajrArc;
Even if the setting is not exactly as it should be , the time retuned is really far from other supposed to be correct times ..

Thanks for helping.

  6. Re: Jazak ALLAH Khair   Reply   Report abuse  
Khaled Al-Shamaa - 2007-12-16 10:00:14 - In reply to message 5 from FREDERIC
Dear Abu Yusuf,

Please check the case now, I add Kuala Lumpur to the list of cities (note: values for your city is 3.1357, 101.688 this information from wikipeida).

I calculate Salat values for today (+7 GMT) and I got the following values:

Fajr: 4:55
Sunrise: 6:10
Zuhr: 12:08
Asr: 16:26
Maghrib: 18:06
Isha: 19:21

Is it the case in your city?

  7. Re: Jazak ALLAH Khair   Reply   Report abuse  
Khaled Al-Shamaa - 2007-12-16 11:59:08 - In reply to message 6 from Khaled Al-Shamaa
By the way, I fix a bug in example file ... in "setLocation" method parameters longitude should be first parameter while latitude should be the second one, I guess this may make you confused before!! is it?

  8. Jazak ALLAH Khair   Reply   Report abuse  
Rahman - 2008-07-02 13:49:04 - In reply to message 7 from Khaled Al-Shamaa
Dear Brother,
I am in jeddah using this information:
logitude: 39.2192
latitude: 21.5169
Zone: +3 GMT
Shool: Shafi

i get this result on the date (for example) 2nd of july 2008:
Fajr => 3:56
Shurooq => 5:55
Dhur => 13:21
Asr => 17:18
Maghrib => 20:48
Isha => 22:47

while the correct result:
Fajr 4:15 AM
Sunrise 5:44 AM
Dhuhr 12:28 PM
Asr 3:46 PM
Maghrib 7:10 PM
Isha 8:40 PM

you can check the time also in this link: ...

i am really trying to figure out what is my mistake...
i will appreciate if you can conect me on my email ajkhalifa (a) gmail com

  9. Re: Jazak ALLAH Khair   Reply   Report abuse  
Rahman - 2008-07-02 13:51:41 - In reply to message 8 from Rahman
sorry this is the result i get..:
[0] => 4:03
[1] => 5:28
[2] => 12:11
[3] => 15:23
[4] => 18:53
[5] => 20:18