Skip to content

Incorrect sunset date when it is after calculator timezone midnight #37

@axl8713

Description

@axl8713

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions