finding age in months, weeks, or days
<p>I have a little java code that finds the date of a person. It looks like this:</p>

<pre><code>  Calendar now = Calendar.getInstance();
  Calendar dob = Calendar.getInstance();

  dob.setTime(birthDay); /*assume this is not null */

  int age = now.get(Calendar.YEAR) - dob.get(Calendar.YEAR);

  if (now.get(Calendar.DAY_OF_YEAR) &lt; dob.get(Calendar.DAY_OF_YEAR)) 
  {
    age--;
  }
</code></pre>

<p>Now, I want to say if the person is less than 1 year old, find how many months this person is. If the person is less than 1 month old, find how many weeks this person is. and if this person is less than 1 week old, find out how many days this person is.</p>

<p>psuedo code:</p>

<pre><code>if (age &lt; 1)
{
    ///?
}
</code></pre>
