How to calculate age in year and month between 2 dates in Java
<p>I am a newbie and appreciate if someone help me out. </p>

<p>When I tried to calculate age using the below source , it does not give me the value of what I want . For example : date->29/12/2010 , dob->30/12/1992 , it will give me 18 instead of 17.
Is there any method that I can code to return me 17yrs 11mths based on the above 2 dates instead of 18yrs0mths? </p>

<pre><code>public double getAgeAsOf( Date date ) {
        return ((date.getTime() - dob.getTime())/(1000*60*60*24))/365;
    }
</code></pre>

<p>Thanks.</p>
