Public Function XZjdday(StarD As Date, StarT As Date, EndD As Date, EndT As Date) As String
Dim TFDay%
Dim TFHour%
Dim B As Single
TFDay = EndD - StarD
TFHour = Hour(EndT)
B = 0
''判断日期是否超过一天
If StarD = 0 Or EndD = 0 Or StarT = 0 Or EndT = 0 Then
XZjdday = 0: Exit Function
End If
If TFDay > 0 Then
If TFHour >= 12 And TFHour < 18 Then
B = B + 0.5
ElseIf TFHour >= 18 Then
B = B + 1
End If
Else
B = B + 1
End If
XZjdday = TFDay + B