title: Best way to convert Milliseconds to number of years, months and days
body: <p>I'm trying to convert a Milliseconds date to number of <code>years</code> <code>months</code> <code>weeks</code> and <code>days</code>.</p>
  
  <p>For example: <code>5 months, 2 weeks and 3 days</code> or <code>1 year and 1 day</code>.</p>
  
  <p>I don't want: <code>7 days</code> or <code>4 weeks</code> > this should be <code>1 week</code> and <code>1 month</code>.</p>
  
  <p>I tried few ways but it always became something like <code>7 days and 0 weeks</code>.</p>
  
  <p>My code:</p>
  
  <pre><code>int weeks = (int) Math.abs(timeInMillis / (24 * 60 * 60 * 1000 * 7));
  int days = (int) timeInMillis / (24 * 60 * 60 * 1000)+1);
  </code></pre>
  
  <p>I have to add 1 to number of days because if I have 23 hours it should be 1 day.</p>
  
  <p>Please explain how to convert it correctly, I think that there is more efficient ways to do it.</p>