mikereedell / sunrisesunsetlib-java

Library for computing the sunrise/sunset from GPS coordinates and a date, in Java.
http://mikereedell.github.com/sunrisesunsetlib-java/
Apache License 2.0
299 stars 69 forks source link

When computing Sunset, date does not increment correctly for UTC #36

Closed jotting closed 6 years ago

jotting commented 6 years ago

I'm using the computeSunsetCalendarmethod in the SolarEventCalculatorfor version 1.2 of the library and have run into a strange error.

I initiated SolarEventCalendar with lat: 44.82897, lon: -93.470116, and timezone UTC.

My inputs are: Zenith solarZenith = Zenith.CIVIL Calendar date = new GregorianCalendar(2017, 5, 14).

When the method is run the result is: 2017-06-14T03:01:00.000Z. The time portion is accurate, but the date should read 2017-06-15.

jotting commented 6 years ago

I'm realizing now the issue is that I'm misusing the function. We're passing in a date for UTC when we should be passing in the date for the location. My apologies.