title: Subtract two dates to get the hourly difference
body: <p>Given two YYYY-MM-DD-HH:MM dates formatted from a string I want to get the time difference in hours between the dates.</p>
  
  <p>This is the code I have:</p>
  
  <pre><code>Dim ds1 As String: ds1 = "March 3, 2015 2:00pm " 
  Dim ds2 As String: ds2 = "March 4, 2015 3:00pm " '25 hours difference 
  
  ds1 = Format(ds1, "YYYY-MM-DD-HH:MM") '2015-03-03-14:00
  ds2 = Format(ds2, "YYYY-MM-DD-HH:MM") '2015-03-04-15:00
  
  Dim d As Date: d = CDate(ds2) - CDate(ds1) 'gives the 25 hour diffrence
  </code></pre>
  
  <p>The code gives a 'Type Mismatch' error on CDate(ds2) and CDate(ds1) since CDate only works on dates and not hours/minutes. </p>
  
  <p>How can I get the hour difference between these dates?</p>