Example for a wrong sunset time with an offset of two hours would be:
Location erdingGermany = new Location(48.3107657, 11.8759098);
TimeZone timeZone = TimeZone.getTimeZone("Europe/Berlin");
SunriseSunsetCalculator calculator = new SunriseSunsetCalculator(erdingGermany, timeZone);
Calendar calendar = Calendar.getInstance();
calendar.set(2022, Calendar.JUNE, 21);
String resultAsString = calculator.getOfficialSunsetForDate(calendar);
assertEquals("21:17", resultAsString); // But was 15:17
…ulations of the SolarEventCalculator
Example for a wrong sunset time with an offset of two hours would be: Location erdingGermany = new Location(48.3107657, 11.8759098); TimeZone timeZone = TimeZone.getTimeZone("Europe/Berlin"); SunriseSunsetCalculator calculator = new SunriseSunsetCalculator(erdingGermany, timeZone);