R
root
Код:
Function Betwindate(Byval d1 As Integer , Byval m1 As Integer , Byval y1 As Integer , Byval d2 As Integer , Byval m2 As Integer, Byval y2 As Integer ) As Long
Dim Result As Long
Dim n1 As Long
Dim n2 As Long
If m1>2 Then
m1 = m1+1
Else
m1 = m1+13
y1 = y1-1
End If
n1 = 36525*y1\100+306*m1\10+d1
If m2>2 Then
m2 = m2+1
Else
m2 = m2+13
y2 = y2-1
End If
n2 = 36525*y2\100+306*m2\10+d2
Result = n2-n1
Betwindate= Result
End Function