Countdown Timer in Angular using $Interval()
<p>I am implementing a function to have a countdown in Angular form current time - existing time in future. If the time has elapsed then display a message. Timer ran out in ..... HH:MM:SS</p>

<ul>
<li>The end time. Lets call it <strong>endTime</strong> eg:
9/15/2016 9:16:00 PM </li>
<li>Current time. Time current moment we live.
Lets call it <strong>currentTime</strong>.</li>
</ul>

<p>The goal is to get a timer that is Current time - end time. Save it to a Variable TotalHours.</p>

<p>Then calculate the time remaining for NOW to total hours. For example TotalHours = 5. And NOW is  9/14/2016 1:16:00 PM then FinalCountDown = 6:16:00 PM. That is the timer I want running...</p>

<p>Here is how I am doing it...</p>

<pre><code>if (info.endTime) {

  var CurrentTime = new Date().toLocaleString('en-US');
  moment.locale(); // en

  var TotalHours = moment.utc(moment(info.diffTime, "DD/MM/YYYY HH:mm:ss").diff(moment(CurrentTime, "DD/MM/YYYY HH:mm:ss"))).format("HH:mm:ss");

  info.finalCountDown= TotalHours;

};
</code></pre>

<p>The issue here is the following:</p>

<p>Case 1:</p>

<pre><code>endTime = 9/15/2016 9:16:00 AM
currentTime = 9/15/2016 1:21:00 PM

TotalHours = 4:05:00
</code></pre>

<p>But... if its after next 2 days...</p>

<p>Case 2:</p>

<pre><code>endTime = 9/17/2016 9:16:00 AM
currentTime = 9/15/2016 1:21:00 PM

TotalHours = 4:05:00

Total hours is still the same...
</code></pre>

<p>I need it to add 24hours + 24 hours + extra time = 48 + 4:05:00 = 52:05:00</p>

<p>also I want it to display as: 52h:05m:00s</p>

<p>Please let me know how to solve this...</p>