C# Sunrise/Sunset with latitude/longitude

Ian Vink picture Ian Vink · Jan 13, 2010 · Viewed 38.6k times · Source

Is there a way in C# to calculate given a latitude and longitude when the sun will set and rise for a given day?

Answer

AnthonyWJones picture AnthonyWJones · Jan 13, 2010

Javascript calculations here. Now you just need to port.


Edit: the calculations are in the source code of this page now.


Edit: here is a direct link to the source code. No need to go hunting through the html.