如何得到本月一共有多少天?

heavenchuang 2003-05-17 03:25:44
如何得到本月一共有多少天?
...全文
94 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
junwhj 2003-05-17
  • 打赏
  • 举报
回复
avr=(a+b)/getmaxday(2003,5)
heavenchuang 2003-05-17
  • 打赏
  • 举报
回复
由于小弟水平有限,烦大哥举个例子,如:avr=(a+b)/getmaxday 如何应用。
感谢!
junwhj 2003-05-17
  • 打赏
  • 举报
回复
Private Function GetMaxDay(intYear As Integer, intMonth As Integer) As Integer
Select Case intMonth
Case 1, 3, 5, 7, 8, 10, 12
GetMaxDay = 31
Case 2
If intYear Mod 100 = 0 Then
If intYear Mod 400 = 0 Then
GetMaxDay = 29
Else
GetMaxDay = 28
End If
Else
If intYear Mod 4 = 0 Then
GetMaxDay = 29
Else
GetMaxDay = 28
End If
End If
Case 4, 6, 9, 11
GetMaxDay = 30
Case Else
GetMaxDay = 30
End Select
End Function

7,785

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧