Closed HamadBangash353 closed 3 years ago
tz.initializeTimeZones(); String timeZoneName = tzmap.latLngToTimezoneString(lat, lng); var timeZoneLocation = tz.getLocation(timeZoneName); final tz.TZDateTime now = tz.TZDateTime.now(timeZoneLocation); var timeInUtc = DateTime.utc(1970, 1, 1); var timeZone = timeZoneLocation.timeZone(timeInUtc.millisecondsSinceEpoch); print(timeZone.offset); currentLocation = cityName; setState(() { final methodParams = selectedMethod != null ? selectedMethod.getParameters() : adhan.CalculationMethod.tehran.getParameters(); methodParams.madhab = selectedMazhab != null ? selectedMazhab : adhan.Madhab.hanafi; methodParams.highLatitudeRule = selectedLatitude != null ? selectedLatitude : adhan.HighLatitudeRule.middle_of_the_night; prayerTimes = adhan.PrayerTimes(adhan.Coordinates(lat, lng), adhan.DateComponents.from(now), methodParams, utcOffset: Duration(milliseconds: timeZone.offset));
This is how i calculate prayer times but in new york it has one hour deff, and for newyork offset value is -18000000 in millis.
You don't need to pass utcOffset if your device (in your case android) is already running in your desired timezone.
might be duplicate of #25
This is how i calculate prayer times but in new york it has one hour deff, and for newyork offset value is -18000000 in millis.