title: VB to C# conversion DateAndTime equivalent
body: <p>I'm trying to convert this VB block to C#.</p>
  
  <pre><code>  Public Function AddWorkingDays(ByVal DateIn As DateTime, _
     ByVal ShiftDate As Integer) As DateTime
      Dim b As Integer
  
      Dim datDate As DateTime = DateIn ' Adds the [ShiftDate] number of working days to DateIn'
      For b = 1 To ShiftDate
          datDate = datDate.AddDays(1)
          ' Loop around until we get the need non-weekend day'
          If Weekday(datDate) = 7 Then
              datDate = datDate.AddDays(2)
          End If
      Next
      Return datDate
  End Function
  </code></pre>
  
  <p>So far I've got</p>
  
  <pre><code>public DateTime AddWorkingDays(DateTime DateIn, int ShiftDate)
  {
      int b = 0;
  
      DateTime datDate = DateIn;
      // Adds the [ShiftDate] number of working days to DateIn
      for (b = 1; b &lt;= ShiftDate; b++)
      {
          datDate = datDate.AddDays(1);
          // Loop around until we get the need non-weekend day
          if (DateAndTime.Weekday(datDate) == 7)
          {
              datDate = datDate.AddDays(2);
          }
      }
      return datDate;
  }
  </code></pre>
  
  <p>I know that there doesn't exist in C# DateAndTime  I just put it in the if statement to complete the block of code. My real problem is getting the IF statement to work. I am not sure if DateTime.Now.Weekday is the same statement as in the previous VB code.</p>