I currently have this:
var x = Convert.ToString(dateTimePicker2.Value.Subtract(dateTimePicker1.Value)); int xDays = Convert.ToInt32(x.Substring(0,1));
But it is ugly and makes me unhappy inside (also does not work for two-digit intervals of the day, for example, 15). Is there a better way to do this?
user961437
source share