title: DateTime difference in Years, Months and Days in C#
body: <p>Imagine I have two DateTime objects, one representing <strong>today's date</strong>, the other representing the <strong>user's supplied date of birth</strong>.</p>
  
  <p>I want to do a simple calculation difference between the two dates and output a string in the following format:</p>
  
  <p><em><strong>17 Years - 2 Months - 18 Days</em></strong></p>
  
  <p>Them numbers are just examples. How can I achieve this in C#?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Yep I've tried all sorts of combinations, but I was only able to get the Years difference like so:</p>
  
  <pre><code>DateTime userDate = SuppliedDate;
  int userAge = DateTime.Now.Year - userDate.Year;
  DateTime today = DateTime.Now;
  if (userDate &gt; today.AddYears(-userAge))
  {
      userAge--;
  }
  Age.Text = userAge.ToString() + " years";
  </code></pre>
  
  <p>Thank You.</p>