title: Calculating elapsed time in hours from a date to current date excluding weekends
body: <p>I need to calculate in hours how much time has elapsed from when a record was created to the current time.  The hard part is I need to exclude weekend times from this.  </p>
  
  <p>I have been working on this for quite a while and I am just lost.  Here is what I have so far.  Thank you in advance for your help.</p>
  
  <pre><code>   Dim MyStartTime As DateTime = "2010-08-09 07:00:00.000"
      Dim MyEndTime As DateTime = DateAdd("h", -1, Now())
  
      Dim MyHours As Integer = 0
  
      If Weekday(MyStartTime) &gt; 1 And Weekday(MyStartTime) &lt; 6 Then
  
          MyHours = DateDiff("h", MyStartTime, MyEndTime)
  
      ElseIf Weekday(MyStartTime) = 6 Then
          Dim EndTime
          date1.Date()
          MyHours = DateDiff("h", MyStartTime, MyEndTime)
  
  
      End If
  
      lblHours1.Text = MyHours
  </code></pre>
  
  <p>What algorithm in VB.NET would best suit this calculation?</p>