Dim diff1 As Period
DateTime.TimeFormat="hh:mm"
diff1 = DateUtils.PeriodBetween.Hours(DateTime.TimeParse("05:10"),DateTime.Time(DateTime.Now))
Label1.Text = diff1.Hours
Dim diff1 As Period
DateTime.TimeFormat="hh:mm"
diff1 = DateUtils.PeriodBetween(DateTime.TimeParse("05:10"), DateTime.Time(DateTime.Now))
Label1.Text = diff1.Hours
Dim diff1 As Period
DateTime.TimeFormat="HH:mm '<-- not "hh:mm"
diff1 = DateUtils.PeriodBetween(DateTime.TimeParse("05:10"), DateTime.Now) ' removed DateTime.Time
Label1.Text = diff1.Hours
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.