suncalc icon indicating copy to clipboard operation
suncalc copied to clipboard

Sunset times are off for Australia

Open mhollanders opened this issue 2 years ago • 3 comments

Hi there,

The follow code gives me the wrong sunrise and sunset times for eastern Australia; Google tells me sunset is at 17:38 AEST (UTC+10).

getSunlightTimes(date = ymd("2023-09-15"),
                 lat = 28.865, lon = 153.565,
                 tz = "Etc/GMT+10",
                 keep = c("sunrise", "sunset"))
    date    lat     lon             sunrise              sunset

1 2023-09-15 28.865 153.565 2023-09-14 09:31:32 2023-09-14 21:53:54

Any idea what's going on?

Matt

mhollanders avatar Sep 15 '23 05:09 mhollanders

Australia is in the Southern Hemisphere; latitude should be negative!

virtualgeoff avatar Sep 16 '23 02:09 virtualgeoff

Hi, you're correct. -28.865, 153.565 still gives the wrong results.

    date     lat     lon             sunrise              sunset

1 2023-09-15 -28.865 153.565 2023-09-14 09:46:16 2023-09-14 21:39:09

mhollanders avatar Sep 17 '23 20:09 mhollanders

I've got the same problem as you. Change time zone of your computer.

sepsep361 avatar Nov 13 '23 19:11 sepsep361