I have a list containing datetimes.
To calculate the difference between 2 DateTime i, use TimeSpan.
public static List<DateTime> list = new List<DateTime>();
TimeSpan ts = new TimeSpan();
double result = 0;
ts = DateTime.Now - list[list.Count-1];
result = ts.TotalSeconds;
When debugging this code, DateTime.Nowu list[list.Count-1]have DateTimes, where DateTime.Now is turned off higher than the list value.
But for some reason, I keep getting 0 in a variable result, how exactly?
Regards, Pete
source
share