title: How can I calculate the 2 datetime picker?
body: <p>I have 2 datetimepickers and I want to know to calculate the day or time.</p>
  
  <p>Ex:</p>
  
  <blockquote>
    <p>2017-01-12 09:00:00<br>
    2017-01-12 10:00:00</p>
  </blockquote>
  
  <p>The answer should be 1:00:00</p>
  
  <p>Below is my code. I also wanna know the date time formatting for this.</p>
  
  <pre><code>&lt;input required type="text" class="form-control" id="time_in"&gt;
  &lt;input required type="text" class="form-control" id="time_out"&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>$start_time = $("#time_in").val();
  $end_time = $("#time_out").val();
  
  $answer = date_diff($start_time, $end_time)
  alert($start_time);  
  </code></pre>