2009-02-16 [.NET VB]計算閏年方法 5073 0 .Net VB 2009-04-16 摘要:[.NET VB]計算閏年方法 Public Shared Function GetBissextile(ByVal startdate As Date, ByVal enddate As Date) As Int16 Dim A_year As Int16 = DatePart(DateInterval.Year, startdate) Dim B_year As Int16 = DatePart(DateInterval.Year, enddate) Dim A_B_Count = B_year - A_year + 1 GetBissextile = 0 For I As Integer = 0 To A_B_Count - 1 If A_year Mod 3200 = 0 And A_year Mod 400 = 0 Or (A_year Mod 4 = 0 And A_year Mod 100 <> 0) Then GetBissextile += 1 End If A_year += 1 Next End Function ASP.NETVB 回首頁