Dim Hours As Integer = 6 '间隔时间
Dim dt1 As Date = #8/20/2019 19:30# '开始时间
Dim dt2 As Date
Dim t1 As Date = dt1.Date.AddHours(20) '当天晚8点
Dim t2 As Date = dt1.Date.Addhours(32) '第二天早8点
If dt1.AddHours(hours) > t1 Then
Dim h1 As Double = (t1 - dt1).TotalHours
dt2 = t2.AddHours(Hours - h1)
Else
dt2 = dt1.AddHours(hours)
End If
Return dt2
[此贴子已经被作者于2019/8/20 17:23:04编辑过]