Not sure what calculation you mean, but I'll guess
Code:Dim dt As DateTime = DateTime.Now Dim whenDT As DateTime = dt.Date.AddHours(21) Dim elaps As New TimeSpan If dt.TimeOfDay > whenDT.TimeOfDay Then whenDT = whenDT.AddDays(1) End If elaps = whenDT - dt 'read about timespan Debug.WriteLine(elaps.ToString)




Reply With Quote