title: Time span calculation for hours and minutes in C#
body: <p>The final result should display the user the time span between the start hour and the end hour.(e.g. start work at 06:30 AM and finished at 18:30 PM, the result to display should be 12 hours).</p>
  
  <p>Now, I have to <code>DateTime</code> parameters; fromTime and toTime
  Each <code>DateTime</code> parameter have an hour in 24 hour format, and also might have a minutes value of 30 min.</p>
  
  <p>What I willing to do is to get the time span between those <code>DateTime</code> parameters.
  For the hours I used this method:</p>
  
  <pre><code>Public TimeSpan GetHourSpan(DateTime fromTime, DateTime toTime)
  {
      TimeSpan fromH = TimeSpan.FromHours(fromTime.Hour);
         TimeSpan toH = TimeSpan.FromHours(toTime.Hour);
         TimeSpan hourTotalSpan = toH.Subtract(fromH);
      return hourTotalSpan;
  }
  </code></pre>
  
  <p>This is great, my problem is to get the time span in minutes if there is, and finally add it to the <code>TimeSpan</code> object to display.</p>
  
  <p>If both have 30 min time span in the above way will return 0, and than I have to start check every parameter if it have a value in the min property.</p>
  
  <p>Isn't there an easy way to get time span for hours and min together?</p>