title: Create Inrement Timer in Javascript
body: <p><strong>Problem</strong></p>
  
  <p>I want a timer that will accept the seconds, minutes, hours, days and start incrementing from there, say user open a page where the time fetched from server is say <code>2 hours 30 minutes 05 seconds</code>, now the javascript timer will start incrementing from this so it <code>02:30:05</code> then <code>02:30:06 .. 02:31:00</code> and so on.. as soon as seconds reach 60 minute is incremented</p>
  
  <p><strong>What I have tried</strong></p>
  
  <p>I have implemented the same using moment.js</p>
  
  <pre><code>var duration = moment.duration({
      'seconds': 30,
          'hour': 2,
          'minutes': 10
  });
  var interval = 1;
  setInterval(function () {
      duration = moment.duration(duration.asSeconds() + interval, 'seconds');
      //.asSeconds() 
      $('.countdown').text(Math.round(duration.asHours()) + 'h:' + Math.round(duration.asMinutes()) + 'm:' + Math.round(duration.asSeconds()) + 's'); //.seconds() 
      $('.countdown1').text(duration.days() + 'd:' + duration.hours() + 'h:' + duration.minutes() + 'm:' + duration.seconds() + 's');
  
  }, 1000);
  </code></pre>
  
  <p><a href="http://jsfiddle.net/raunakkathuria/UK6SM/" rel="nofollow">JSfiddle</a></p>
  
  <p><strong>Requirement</strong></p>
  
  <p>I want to know how i can implement it using <strong>javascript/jquery</strong> if possible else I will use <code>moment.js</code> one, I have looked around but all have countdown timer created from date, so the input will be <code>seconds, minutes, hours, days</code> and the counter will start from there in increment manner</p>