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 >= 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
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)