-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Description
When calculating sunset time for a location in the western hemisphere, there is no 1-day shift for the sunset when it is after the midnight of the timezone used for the calculator.
Location location = new Location("39.9522222", "-75.1641667");
SunriseSunsetCalculator calculator = new SunriseSunsetCalculator(location, "UTC");
Calendar calendar = new GregorianCalendar(2018, 04, 18);
calculator.getOfficialSunriseCalendarForDate(calendar); // 2018-05-18T09:43
calculator.getOfficialSunsetCalendarForDate(calendar); // 2018-05-18T00:12 <--- should be 2018-05-19T00:12
On the other hand, the shift is considered for the eastern hemisphere.
Location location = new Location("39.9522222", "75.1641667");
SunriseSunsetCalculator calculator = new SunriseSunsetCalculator(location, "UTC");
Calendar calendar = new GregorianCalendar(2018, 04, 18);
calculator.getOfficialSunriseCalendarForDate(calendar); // 2018-05-17T23:42
calculator.getOfficialSunsetCalendarForDate(calendar); // 2018-05-18T14:10
Metadata
Metadata
Assignees
Labels
No labels