当前位置: 代码迷 >> ASP >> 月时间
  详细解决方案

月时间

热度:149   发布时间:2012-03-09 21:42:54.0
求一个月时间
用什么代码可以得到.每一个月的最后一天.
就像
2月.就28天.
8月.31


------解决方案--------------------
Function GetDaysInMonth(ByVal iMonth As Integer, ByVal iYear As Integer) As Integer
Select Case iMonth
Case 1, 3, 5, 7, 8, 10, 12
GetDaysInMonth = 31
Case 4, 6, 9, 11
GetDaysInMonth = 30
Case 2
If IsDate( "February 29, " & iYear) Then
GetDaysInMonth = 29
Else
GetDaysInMonth = 28
End If
End Select
End Function
  相关解决方案