title: Automatic human readable time interval
body: <p>I would like to express some <strong>time intervals</strong> in a human readable format. I was looking for a library automatically able to choose the correct size of the units. The intervals will range from milliseconds to weeks. Something like</p>
  
  <ul>
  <li>0.2s</li>
  <li>2:00</li>
  <li>4 days</li>
  <li>...</li>
  </ul>
  
  <p>I know I could manually check the size of the argument and then convert it but before reinventing the wheel I wanted to ask if there is a (standard) library to achieve that.</p>
  
  <ul>
  <li><a href="http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/TimeUnit.html" rel="noreferrer">TimeUnit</a> does the conversions but there is no knowledge about the size of the argument</li>
  <li>a <a href="http://www.joda.org/joda-time/" rel="noreferrer">Joda-Time</a> <a href="http://www.joda.org/joda-time/key_duration.html" rel="noreferrer">Duration</a> represents exactly what I need but I did not find much about representation (but for the ISO8601 formatting of <a href="http://www.joda.org/joda-time/apidocs/org/joda/time/ReadableDuration.html" rel="noreferrer">ReadableDuration</a>)</li>
  </ul>
  
  <p><strong>Edit</strong>:</p>
  
  <p>My input in in nanoseconds and output as described above.</p>