第1个回答 2016-03-17
Public Function IsRunnian(ByVal n As Integer) As Boolean
Dim res As Boolean
res = False
If n Mod 400 = 0 Then
res = True
End If
If (n Mod 100 <> 0) And (n Mod 4 = 0) Then
res = True
End If
IsRunnian = res
End Function
Public Function Fc(ByVal td As Date) As Byte
Dim y As Integer
Dim m As Integer
Dim d As Integer
Dim yc As Integer
Dim mc As Integer
Dim dc As Integer
y = Year(td)
m = Month(td)
d = Day(td)
dc = d
If IsRunnian(y) Then
mc = Val(Mid("512503514624", m, 1))
Else
mc = Val(Mid("622503514624", m, 1))
End If
yc = ((y Mod 100) \ 4 + (y Mod 100)) Mod 7
Fc = (yc + mc + dc) Mod 7
End Function本回答被提问者采纳