title: How to convert timespan to datetime
body: <p>I have 3 datepickers that are on time formats:
  Time From, Time To and Duration.</p>
  
  <p>First I need to get the difference of Time From and Time to and display it to the Duration DatePicker.</p>
  
  <pre><code>        DateTime fromTime = dtFrom.Value;
          DateTime toTime = dtTo.Value;
  
          TimeSpan duration = toTime.Subtract(fromTime)
  
          dtNoOfHours.Value = duration;
  </code></pre>
  
  <p>But I am having an error of: <strong>System.InvalidCastException</strong></p>
  
  <p>How to convert timespan to datetime?</p>