title: How to calculate timedifference in vb6
body: <p>I want to calculate time difference in vb6. i had been done it in vb.net. but i don't know how to convert in vb6.Because the datetime type will not be available in vb6.</p>
  
  <p>i have pasted my vb.net code below. how to do the same in vb6?</p>
  
  <pre><code>Public Sub timecal()
      Dim dFrom As DateTime
      Dim dTo As DateTime
      Dim tempstarttime As DateTime
      Dim idletime As String = "00:05:00"
      Dim Needtosub As String = "00:01:00"
      Dim timeDiff As String
      If DateTime.TryParse(start_time, dFrom) AndAlso DateTime.TryParse(end_time, dTo) Then
          Dim TS As TimeSpan = dTo - dFrom
          Dim hour As Integer = TS.Hours
          Dim mins As Integer = TS.Minutes
          Dim secs As Integer = TS.Seconds
          timeDiff = ((hour.ToString("00") + ":") + mins.ToString("00") + ":") + secs.ToString("00")
          sscheck1 = False
          If timeDiff &gt;= idletime Then
              tempstarttime = System.DateTime.Parse(end_time)
              tempstarttime = tempstarttime.AddMinutes(-1)
              start_time = Strings.Format(tempstarttime, "yyyy-MM-dd HH:mm:ss")
              sscheck1 = True
          End If
      End If
  End Sub
  </code></pre>