Prayer-Times-Android-Azan icon indicating copy to clipboard operation
Prayer-Times-Android-Azan copied to clipboard

DST TIme

Open maste98 opened this issue 3 years ago • 2 comments

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.

maste98 avatar Apr 23 '21 19:04 maste98

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 .

nurrakhmad avatar Apr 23 '21 21:04 nurrakhmad

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);
    }

limooapp avatar Apr 30 '21 15:04 limooapp