Mam dwa razy, a ich wartości są pobierane z XML z sieci.Podziel czas według 2?
XElement xmlWdata = XElement.Parse(e.Result);
string SunRise = xmlWdata.Element("sun").Attribute("rise").Value;
string SunSet = xmlWdata.Element("sun").Attribute("set").Value;
DateTime sunrise = Convert.ToDateTime(SunRise.Remove(0,11));
DateTime sunset = Convert.ToDateTime(SunSet.Remove(0, 11));
Daje to med czas: 04:28 na wschód i 22:00 na zachód słońca. Jak wtedy zrobić kalkulację gdzie biorę:
(sunrise + (sunset-sunrise)/2)
Większość kodu tutaj nie ma nic wspólnego z pytaniem. Można zadać bardzo krótkie pytanie. – usr