You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two separate issues here, and neither is actually a bug in the calculation:
Latitude sign — Australia is southern hemisphere, so -28.865 (already caught by @virtualgeoff). ✓
Timezone string — Etc/GMT+10 is a POSIX gotcha: the sign is inverted, so it means UTC−10, not AEST. AEST (UTC+10) is Etc/GMT-10, or better just Australia/Brisbane. The 20-hour error from this is what landed sunset on the wrong day.
With both corrected, the math is spot on. Verified against the underlying SunCalc v2:
SunCalc works entirely in UTC instants; getting local wall-clock time right is just a matter of formatting those in the correct zone. Closing as resolved.
Activity
virtualgeoff commentedon Sep 16, 2023
Australia is in the Southern Hemisphere; latitude should be negative!
mhollanders commentedon Sep 17, 2023
Hi, you're correct. -28.865, 153.565 still gives the wrong results.
1 2023-09-15 -28.865 153.565 2023-09-14 09:46:16 2023-09-14 21:39:09
sepsep361 commentedon Nov 13, 2023
I've got the same problem as you. Change time zone of your computer.
mourner commentedon Jun 18, 2026
Two separate issues here, and neither is actually a bug in the calculation:
-28.865(already caught by @virtualgeoff). ✓Etc/GMT+10is a POSIX gotcha: the sign is inverted, so it means UTC−10, not AEST. AEST (UTC+10) isEtc/GMT-10, or better justAustralia/Brisbane. The 20-hour error from this is what landed sunset on the wrong day.With both corrected, the math is spot on. Verified against the underlying SunCalc v2:
SunCalc works entirely in UTC instants; getting local wall-clock time right is just a matter of formatting those in the correct zone. Closing as resolved.