mourner / suncalc

A tiny JavaScript library for calculating sun/moon positions and phases.
BSD 2-Clause "Simplified" License
3.07k stars 412 forks source link

moontimes always a few minutes off #122

Open jovrstra opened 5 years ago

jovrstra commented 5 years ago

Hello, I'm trying to use suncalc to calculate the moon data, but my moon times are always a few minutes off (5-15 minutes); phase also seems off. I seem to have the same issue for all locations I tried (I tried some at sea level, to rule out altitude influence) and have no idea where else I can start looking... I'm comparing the output of suncalc.js with the suncalc.org website, so I suspect they should be the same... It has to be something I do wrong, but I don't know... One example I used is this one: var date = new Date('2018-10-07'), lat = 51.50735, lng = -0.12776; then a call to getMoonPosition(date,lat,lng,false) and I get a moonrise of Sun, 7 Oct 2018, 3:42:45 GMT The website gives 4:33:28. The fact that it is one hour off is probably due to timezones/utc, but I don't get why the minutes are off by that much.

Any clues on what I could be doing wrong? Thanks!

stevenmusumeche commented 4 years ago

same issue