Julia implementation of the SunCalc package for calculating sun position, sunlight phases (times for sunrise, sunset, dusk, etc.), moon position, and lunar phase for the given location and time.
Most calculations are based on the formulas given in the Astronomy Answers articles about position of the sun and the planets. You can find more information on twilight phases calculated by SunCalc.jl in the Twilight article on Wikipedia.
The package is registered in the General registry and can therefore be installed with:
using Pkg
pkg.add("SunCalc")