I have the lat and long of a location and want to know whether it is day or night in that location or at least know the time there.
Is there a way to do this without using web services?
I have the lat and long of a location and want to know whether it is day or night in that location or at least know the time there.
Is there a way to do this without using web services?
There is an explanation of how to calculate the time of sunrise and sunset at http://williams.best.vwh.net/sunrise_sunset_algorithm.htm
That produces a result in UTC. The phone knows the current time in UTC. So you can then work out whether the sun has set, and how long ago, at the location you want.