title: How to calculate timespan (days) between 2 dates from timepicker in a class
body: <p>I am trying to pass 2 variables check in date and check out date from 2 different date time picker on a form. The goal is two calculate the number of day between the 2 dates. </p>
  
  <p>Here is what I have so far:</p>
  
  <p>From the form:</p>
  
  <pre><code>Public Class FormReservations
  
  'Declare the new objects:
  
  Private TheRegularPriceObject As ClassRegularPrice
  
  
  Private Sub ButtonCalculateRate_Click(sender As Object, e As EventArgs) Handles ButtonCalculateRate.Click
  
  TheRegularPriceObject = New ClassRegularPrice(DateTimePickerCheckIn.Value.Date.ToString("dd/MM/yyyy"),DateTimePickerCheckOut.Value.Date.ToString("dd/MM/yyyy"))
  
  
  
  
          LabelNumberOfDay.Text = TheRegularPriceObject.CalculateNumberOfDay.ToString()
      End If
  
  
  End Sub
  </code></pre>
  
  <p>End Class</p>
  
  <p>This is from the class</p>
  
  <pre><code> Public Class ClassRegularPrice
  
  
  
  Protected CheckInDateVar As String
  
  Protected CheckOutDateVar As String
  Protected NumberOfDaySpan As Integer
  
  'Constructor: 
  
  Public Sub New(ByVal CheckInDateConst As String, ByVal CheckOutDateConst As String)
  
  CheckInDate = CheckInDateConst
  CheckOutDate = CheckOutDateConst
  CalculateNumberOfDay()
  End Sub
  
  Property CheckInDate() As Date
      Get
          Return CheckInDateVar
      End Get
      Set(ByVal Value As Date)
          CheckInDateVar = Value
      End Set
  End Property
  
  
  Property CheckOutDate() As Date
      Get
          Return CheckOutDateVar
      End Get
      Set(ByVal Value As Date)
          CheckOutDateVar = Value
      End Set
  End Property
  Sub 
  
  
   'Methods:
  Sub CalculateNumberOfDay()
  
      NumberOfDaySpan = (CheckOutDateVar - CheckInDateVar)
  End Sub
  </code></pre>
  
  <p>It is not returning a value and I'm not sure I converted my date to string also, but this is what I have been told to do. I am not sure from there how the calculation should work since this is a string... Any help would be greatly appreciated.:)</p>