Capture Sunset and Surise Time in Ignition

How can I capture Sunset and Sunrise Time in Perspective ignition ?
Can you provide me some direction?

You could use to get these values from an online API. One example: Sunset and sunrise times API -

You could also do the calculations yourself: ESRL Global Monitoring Laboratory - Global Radiation and Aerosols


There are very good resources from the NOAA organisation but I couldnt find the specific links so you will need to search further.
In the past I found sample spreadsheets (NOAA_Solar_Calculations_day.xls) for the relevant calculations for the Equation Of Time. Using the sample spreadsheets you can change the parameters and it will give various solar time calculation results, then you can implement the same equations in python to be able to use within any Ignition project driven by parameters for lat/long, TZ and date.
This link may help
GitHub - porrey/Solar-Calculator: Calculates the sunrise and sunset for a given date and location (using GEO coordinates). This library uses the method outlined NOAA Solar Calculations Day spreadsheet found at

1 Like