title: C++ how to subtract two time variables
body: <p>I have a bunch of time variables in the format "day-month-year H:M", for example, 14-03-15 15:25. How do I correctly measure the difference between two time variables and output a duration type? </p>
  
  <pre><code>std::string t1 = 14-03-15 15:25;
  std::string t2 = 19-05-15 7:32;
  
  template &lt;typename Duration&gt;
  auto diff(std::string&amp; t1, std::string&amp; t2) {
     // How to do from here?
  } 
  
  auto ds = diff&lt;std::chrono::seconds&gt;(t1, t2);
  auto dm = diff&lt;std::chrono::minutes&gt;(t1, t2);
  </code></pre>