title: How to get the difference of two dates in mm-dd-hh format in Javascript
body: <p>I can get the difference between two dates using moment.js or plain js. </p>
  
  <p>in moment.js </p>
  
  <pre><code>var a = moment(timestamp1);
  var b = moment(timestamp2);
  var month =a.diff(b, 'month');
  var day =a.diff(b, 'day') - month;
  var year =a.diff(b, 'hours');
  </code></pre>
  
  <p>month returns month , days return difference in days . But I want the answer in </p>
  
  <p>MM-DD-hh format for example  2 months 12 days 5 hours . I can not convert the  day directly cause there is other issues like leap year . Is there any other way then going all out and calculating everything ? I am doing this in angular js if that is of any help </p>