sunrise & sunset times based on location & time zone?

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?


I’ve used this in my weather app:

which I converted to UnityScript: