Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including star-rise-and-set-times with all npm packages installed. Try it out:

var starRiseAndSetTimes = require("star-rise-and-set-times")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

star-rise-and-set-times v1.0.0

A library for calculating the rising and setting times of stars.


Here is a browser-based tool for calculating the rising and setting times of stars. You can try it online here.

star rise and set calculator screenshot

The code is based on formulae from various sources with much credit to Barry Carter for his help and patience.

This tool does not take into account atmospheric refraction, which can affect rising/setting times by several minutes - if you need that kind of accuracy then see this page from the US Naval Observatory. The results have been checked against various other online tools, written by people far more competent than me, and they broadly agree, although each tool gives slightly different answers. It is probably safe to assume accuracy to within ±10 minutes.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free