This function will calculate the date difference from today to the date passed to this function. Send it the Date in the form of DateTime in asp.net C#. int[] monthDay = new int[12] { 31, -1, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; DateTime fromDate=DateTime.Now ; DateTime toDate=dt; string difference; int year; int month; int day; int increment = 0; if (fromDate.Day > toDate.Day) { increment = monthDay[fromDate.Month - 1]; } if (increment == -1) { if (DateTime.IsLeapYear(fromDate.Year)) { increment = 29; } else { ...