Time/Date APIs - Astronomical Twilight

Unfortunately no. There is not enough data available to create an accurate calculation. One of the main items missing is location information (GPS coordinates). This along with a few other items needed made it impossible. Generally speaking though, you could get an estimate based Sunset and Sunrise. Since Astronomical twilight is when the sun is 18 degrees below the horizon, you could guesstimate that it takes approximately 1.2 hours after sunset.

Again that is very rough calculation since Longitude is needed to get the declination. I gave on it and instead have made requests for additional API data from the OpenWeather app. There are some additional functions that they provide that would cover astronomical terms. Still waiting on that one.

If you really want to get sciency, then here is the spot for figuring out the calculations:


Thank for your quick and detailed reply and your efforts.
I would quite like to add a reasonably accurate time for astronomical twilight to a face, mmm, I will keep thinking about it.

1 Like