[ Root ]
This page contains an implementation of the Montenbruck and Pfleger sunrise / moonrise / twilight algorithm in JavaScript. The algorithm is described in detail elsewhere in this site and should work for all latitudes even within the (ant) arctic circles. There will be a 'fuzzy zone' at around latitude 67.43 as a result of using approximate Sun postion routines - and a similar zone around the 'lunar arctic circle' - but real rise and set times depend strongly on your local horizon anyway. Treat any 'days' or 'nights' shorter than about 20 minutes with caution.
View the source of this page to see the Javascript code. Save this page to your computer to run the code offline - you don't need to visit this Web address to be able to use the page! This page has been tested on Netscape 4.7x, Netscape 6.2, MS Internet Explorer 6 and Opera 7.