title: Calculate Year, Month and Day between two Dates in C#
body: <p>I want exact Year, Month and Day elapsed between two dates.</p>
  
  <pre><code>DateTime startDate = new DateTime(1974, 8, 15);
  
  DateTime endDate = DateTime.Now.ToLocalTime();
  </code></pre>
  
  <p>I wish to find Number of Years, Months and Days elapsed between the above two days using C#?</p>
  
  <blockquote>
    <p>My Expected Output</p>
    
    <p>Years: <strong>68</strong> Months: <strong>10</strong> Days: <strong>23</strong></p>
  </blockquote>
  
  <p>I referred one of the post, in that they explained about only days <a href="https://stackoverflow.com/questions/1607336/calculate-difference-between-two-dates-number-of-days">Calculate difference between two dates (number of days)?</a></p>
  
  <p>But I need all three - Year, Month and Day. Kindly assist me how to calculate...</p>
  
  <p><strong>Explanation for Duplicate</strong>:
  Already a question with same logic posted in <a href="https://stackoverflow.com/questions/6260372/calculate-years-months-weeks-and-days">Calculate Years, Months, weeks and Days</a>, the answer provided in that question is too lengthy and <strong>in my question I asked only Year, Month and Date not Week</strong>. <strong>The Concept is same but the logic is different for calculating days comparing to that question</strong>, Here I got the answer in a very simplified manner. <strong>I satisfied in my answer</strong>.</p>
  
  <p><strong>Exact Duplicate:</strong></p>
  
  <p>Original Question: <a href="https://stackoverflow.com/questions/1083955/how-to-get-difference-between-two-dates-in-year-month-week-day">How to get difference between two dates in Year/Month/Week/Day?</a> (<strong>Asked 7 Years ago</strong>)</p>
  
  <p>Your Marked Question: <a href="https://stackoverflow.com/questions/6260372/calculate-years-months-weeks-and-days">Calculate Years, Months, weeks and Days</a>  (<strong>Asked 5 Years ago</strong>)</p>