Dim diff1 As Period DateTime.TimeFormat="hh:mm" diff1 = DateUtils.PeriodBetween.Hours(DateTime.TimeParse("05:10"),DateTime.Time(DateTime.Now)) Label1.Text = diff1.Hours
Sub HoursMinutesBetween(Startime As String, Endtime As String) As String
Dim diff1 As Period
DateTime.DateFormat= "MM/dd/yyyy hh:mm a" 'you must involve the date also. You can use a different date format
diff1 = DateUtils.PeriodBetween(DateTime.DateParse(Startime), DateTime.DateParse(Endtime) )
Return $"${NumberFormat(diff1.Hours,2,0)}:${NumberFormat(diff1.minutes,2,0)}"$
End Sub
Sub HoursMinutesBetween(Startime As String, Endtime As String) As String
Dim diff1 As Period
DateTime.DateFormat= "MM/dd/yyyy hh:mm a" 'you must involve the date also. You can use a different date format
diff1 = DateUtils.PeriodBetween(DateTime.DateParse(Startime), DateTime.DateParse(Endtime) )
Return $"${NumberFormat(diff1.Hours,2,0)}:${NumberFormat(diff1.minutes,2,0)}"$
End Sub