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

UTC causing issues? #4

Closed anthonywebb closed 11 years ago

anthonywebb commented 11 years ago

Something is odd, perhaps someone can explain, if I run this from my mac laptop (which is in MST by default) everything returns as expected, spot on.

If I move the script to our server, which is in UTC time, all the dawn, disk, sunrise, sunset, etc. values are all off, even though the date/locations are all the same as my computer. I suspect maybe the fact the date is UTC is causing issues perhaps?

Anyone have any ideas?

mourner commented 11 years ago

SunCalc calculations are base on the local time, so you'll have to adjust for that.