title: Subtract time in VB.net
body: <p>I am trying to subtract two times.</p>
  
  <pre><code>Sub notifier(checkouttime As Label)
          Dim checktime As New DateTime(checkouttime.Tag)
          Dim currenttime As New DateTime(DateAndTime.TimeOfDay.ToString("hh:mm:ss"))
  
          Dim balance As TimeSpan = checktime - currenttime
      End Sub
  </code></pre>
  
  <p>on my checkouttime.tag has a time value of under this format "hh:mm:ss"</p>
  
  <p>and I have to get the current time for today with the same format and I achieve it but when I need to subtract them I am getting an error.</p>
  
  <pre><code>An unhandled exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll
  
  Additional information: Conversion from string "08:00:58" to type 'Long' is not valid.
  </code></pre>
  
  <p>Thanks in advance</p>