title: How to calculate time difference of 2 datetime object in AngularJS?
body: <p>I am very new in AngularJS and  I want to calculate time difference between <code>two datetime object with format</code>:</p>
  
  <blockquote>
    <p>Hour:Minutes:Seconds</p>
  </blockquote>
  
  <p>But I want to get double digit output in time :</p>
  
  <blockquote>
    <p>Expected Output: 00 : 00 : 04</p>
  </blockquote>
  
  <p><strong>Input:</strong> </p>
  
  <pre><code>StartDate=2016-06-29 15:52:32.360
  
  EndDate=2016-06-29 15:53:36.970
  
  Expected output: 00 : 01 : 04
  </code></pre>
  
  <p>This is my code:</p>
  
  <pre><code>public class User
  {
        public int Id { get; set; }
        public Nullable&lt;System.DateTime&gt; StartDateTime { get; set; }
        public Nullable&lt;System.DateTime&gt; EndDateTime { get; set; }
  }
  
  Json output:
  
  [
    {
      "Id": 121,
      "StartDateTime": "\/Date(1467195752360)\/",  //2016-06-29 15:52:32.360
      "EndDateTime": "\/Date(1467195756970)\/", //2016-06-29 15:53:36.970
    },
    {
      "Id": 122,
     "StartDateTime": "\/Date(1467195752360)\/",// 2016-06-29 15:52:32.360
  
      "EndDateTime": "\/Date(1467195758360)\/", //2016-06-29 15:53:36.970
    }
  ]
  </code></pre>
  
  <p>Code: </p>
  
  <pre><code> &lt;td  ng-repeat="item in User"&gt;
        //How to display time difference here
        &lt;p&gt; Hour : Minutes : Seconds  &lt;/p
    &lt;/td&gt;
  </code></pre>