sunrise & sunset times based on location & time zone?

https://github.com/erndev/EDSunriseSet

i used this code before to check the sunrise & sunset times to tell when the user is playing at night to change the game (lower light, increase mobs) based on that

is there an easy way to do this with unity?

thanks

I’ve used this in my weather app:

http://williams.best.vwh.net/sunrise_sunset_algorithm.htm

which I converted to UnityScript: