Timespan
DateTime dt1 = firstdate; DateTime dt2 = seconddate; TimeSpan ts = dt1 - dt2; int hours = ts.Hours;
DateTime startTime = Convert.ToDateTime(DateTimePicker1.value); DateTime endTime = Convert.ToDateTime(DateTimePicker2.value); TimeSpan span = endTime.Subtract(startTime); int hoursDifference = span.Hours;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)