求教计算任何一个月的天数的算法:
参数:某年某月(2004-07-01),结果:这个月有多少天
参数:某年某月(2004-07-01),结果:这个月有多少天
解决方案 »
- FindWindowEx查找VB程序正常,查找VC程序却出问题了
- VB中提示实时错误下标越界9什么问题啊!我是新手
- VB中有没有HashMap之类的东西?
- (SOS)SQL超時,數據丟失
- 原创开源自动更新程序大家捧捧场前20名有分
- 求一个下载的api函数
- V中如何创建多线程?
- SetWindowPos FrmHandle,-1,0,0,0,0,3 是把窗体置顶,那要把窗体还原为常规窗体,-1,0,0,0,0,3应该怎么改?
- 今天阻止了小偷行窃,很开心,放分100
- 安装问题
- 请问大侠:Access2000,internet网怎么访问!!解决后分多多!!
- 三层结构中,中间件与客户端间如何传递RECORDSET数据
Public Function GetLastDay(ByVal intYear As Integer, ByVal intMonth As Integer) As Integer
Select Case intMonth
'2月
Case 2
If (((intYear Mod 4) = 0 And (intYear Mod 100) <> 0) Or ((intYear Mod 400) = 0)) Then
GetLastDay = 29
Else
GetLastDay = 28
End If
'大月
Case 1, 3, 5, 7, 8, 10, 12
GetLastDay = 31
'小月
Case 4, 6, 9, 11
GetLastDay = 30
End Select
End Function
'其中 y 是年份,m 是月份
MaxDay = Day(DateSerial(y, m + 1, 0))
End Function