Basically, you can subtract two DateTimes and get a TimeSpan as a result:
DateTime start = new DateTime(2015, 12, 1, 20, 0, 0);
DateTime end = new DateTime(2015, 12, 2, 4, 30, 10);
TimeSpan span = end - start;
int hours = span.Hours;
int minutes = span.Minutes;
int seconds = span.Seconds;
int days = span.Days;
double totalDays = span.TotalDays;
You can find find more informations on TimeSpan structure here:
MSDN: TimeSpan Structure[
^]
To answer to your question, we would need to know which type your
Vals
variable is an enumeration of; and if this type is not a common one (i.e., you defined it yourself), we would need to know how its maxdate and mindate members are defined.