Prayer-Times-Android-Azan
Prayer-Times-Android-Azan copied to clipboard
DST TIme
Is the dst functionality accurate? For example I live in America central time, we are currently in daylight savings, but when calculating salah times I have to put dst as 0, because if I put it as 1 it will be an hour ahead and inaccurate . Similarly when daylight savings turns off, I have to change the dst value to -1. I can still use it like this, but it seems as though the dst integer is off by 1, 0 should mean off(no dst), 1 should mean 1 hour of dst, etc.
Please translite in to indonesian lengue
mamad
Pada tanggal Sab, 24 Apr 2021 02:33, Adil Hamid @.***> menulis:
Is the dst functionality accurate? For example I live in America central time, we are currently in daylight savings, but when calculating salah times I have to put dst as 0, because if I put it as 1 it will be an hour ahead and inaccurate . Similarly when daylight savings turns off, I have to change the dst value to -1. I can still use it like this, but it seems as though the dst integer is off by 1, 0 should mean off(no dst), 1 should mean 1 hour of dst, etc.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ahmedeltaher/Prayer-Times-Android-Azan/issues/27, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOQ5UC5XPPLZLKWY4I62MXDTKHDPDANCNFSM43PGSYSA .
hello for calculate Automatic i use this method. val location = Location(latitude, longitude, altitude, GMT_DEFF, DTS)
For DTS Automatic
public int GMT_DSTSavings(){
Calendar c = Calendar.getInstance();
TimeZone z = c.getTimeZone();
int offset = 0;
if(z.inDaylightTime(new Date())){
offset = z.getDSTSavings();
}
return offset / 1000 / 60 / 60;
}
For GMT_DEFF Automatic
public double GMT_Decimal(){
Calendar c = Calendar.getInstance();
int offsetHrs = offset / 1000 / 60 / 60;
int offsetMins = offset / 1000 / 60 % 60;
return Time_to_Decimal(offsetHrs,offsetMins,0);
}
//Convert Time TO Decimal Double
public double Time_to_Decimal(int hours , int minutes , int seconds){
return hours + (minutes * 0.016666666666667) + (seconds * 0.000277777777778);
}