Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getTimes returns a sunrise/sunset on the next day for certain lat/long #174

Open
jordanwegener opened this issue Nov 23, 2023 · 0 comments

Comments

@jordanwegener
Copy link

Using getTimes for some coordinates (close to a TZ border) and times close to but before midnight appears to produce an incorrect sunset time that is on the following day.

To reproduce, call getTimes with:

{
  time: new Date('2022-04-14T23:40:15.817+08:00')
  lat: -14.414989274961663,
  lon: 128.52523583273717,
  timezone: 'Australia/Perth'
}

I get back:

{
  times: {
    solarNoon: 2022-04-15T03:27:08.981Z,
    nadir: 2022-04-14T15:27:08.981Z,
    sunrise: 2022-04-14T21:33:37.354Z,
    sunset: 2022-04-15T09:20:40.607Z,
    sunriseEnd: 2022-04-14T21:35:51.374Z,
    sunsetStart: 2022-04-15T09:18:26.587Z,
    dawn: 2022-04-14T21:12:00.824Z,
    dusk: 2022-04-15T09:42:17.137Z,
    nauticalDawn: 2022-04-14T20:47:00.521Z,
    nauticalDusk: 2022-04-15T10:07:17.441Z,
    nightEnd: 2022-04-14T20:22:04.702Z,
    night: 2022-04-15T10:32:13.259Z,
    goldenHourEnd: 2022-04-14T22:02:20.087Z,
    goldenHour: 2022-04-15T08:51:57.875Z
  }
}

converted to local date strings for Australia/Perth TZ

sunrise: '15/04/2022, 07:33:37'
sunset: '15/04/2022, 19:20:40'
@jordanwegener jordanwegener changed the title getTimes returns a sunset on the next day for certain lat/long getTimes returns a sunrise/sunset on the next day for certain lat/long Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant