public void Init() { bool isSunrise = false; bool isSunset = false; DateTime sunrise = DateTime.Now; DateTime sunset = DateTime.Now; int ltD = (int)LocationData.Latitude; //DateTime = DateTime.AddDays(10); SunTimes.Instance.CalculateSunRiseSetTimes(new SunTimes.LatitudeCoords ((int)LocationData.Latitude, (int)((LocationData.Latitude - (int)LocationData.Latitude) * 60), 0, SunTimes.LatitudeCoords.Direction.North), new SunTimes.LongitudeCoords ((int)LocationData.Longitude, (int)((LocationData.Longitude - (int)LocationData.Longitude) * 60), 0, SunTimes.LongitudeCoords.Direction.East), CurrentDateTime, LocationData.TimeZone, ref sunrise, ref sunset, ref isSunrise, ref isSunset); if (CurrentDateTime > sunset) { DateTime sunrise2 = DateTime.Now; DateTime sunset2 = DateTime.Now; SunTimes.Instance.CalculateSunRiseSetTimes(new SunTimes.LatitudeCoords ((int)LocationData.Latitude, (int)((LocationData.Latitude - (int)LocationData.Latitude) * 60), 0, SunTimes.LatitudeCoords.Direction.North), new SunTimes.LongitudeCoords ((int)LocationData.Longitude, (int)((LocationData.Longitude - (int)LocationData.Longitude) * 60), 0, SunTimes.LongitudeCoords.Direction.East), CurrentDateTime.AddDays(1), LocationData.TimeZone, ref sunrise2, ref sunset2, ref isSunrise, ref isSunset); sunrise = sunset; sunset = sunrise2; } SunRise = LocationData.GetStandardTime(sunrise); SunSet = LocationData.GetStandardTime(sunset); Muthurtha = new AstroMuhurtha(LocationData.OriginalDateTime, SunRise, SunSet); }