title: Calculate time until the next occurance of 2pm using moment.js
body: <p>I'm looking to use moment.js to calculate the time remaining until the next occurance of 2pm. </p>
  
  <p>So far, based on another script I found I have the following:</p>
  
  <pre><code>var getTimeLeft = function(){
    var now = moment();
    var deadline = now.clone().hour(14).minute(0).second(0);
    if(now.isAfter(deadline)) {
      var tomorrow  = moment(new Date()).add(1,'days').hour(14).minute(0).second(0);
      console.log(tomorrow.from(now));
    }else {
      console.log(deadline.from(now));
    }
  }
  getTimeLeft();
  </code></pre>
  
  <p>If the time is before 2pm this returns the time in a rounded format ie "in 5 hours"</p>
  
  <p>If the time is beyond 2pm this returns "in a day"</p>
  
  <p>How can I edit this script so that if it's run before 2pm I'll get the answer in the format <code>"4hrs 57mins"</code> without rounding - and if it's the following day it will do the same, it <code>"21hrs 2mins"</code> ?</p>
  
  <p>Cheers</p>