This codesnippet for finding the differences between two given dates.
You can calculate for the months and years also by using this.
DateTime dt1 = Convert.ToDateTime(TextBox1.Text.ToString());
int t1 = dt1.Day;
DateTime dt2 = Convert.ToDateTime(TextBox2.Text.ToString());
int t2 = dt2.Day;
DateTime r1 = new System.DateTime(dt2.Year, dt2.Month, dt2.Day, 12, 0, 0);
DateTime r2 = new System.DateTime(dt1.Year, dt1.Month, dt1.Day, 12, 0, 0);
System.TimeSpan result = r1 - r2;
Response.Write(result.Days);