计算闰年主要是为了判断2月份的天数,一般闰年2月份是29天,平年2月份是28天。计算闰年的算法非常简单,即:能被400整除,或者能被4整除而不能被100整除。 算法如下: function isLeapYear(pYear)
set oreg=new RegExp
oreg.Pattern=”^\d{4}$”
if not oreg.Test(pYear) then
isLeapYear=false
exit function
end if
oYear=clng(pYear)
if ((oYear mod 4=0 and oYear mod 100<>0) or oYear mod 400=0) then
isLeapYear=true
else
isLeapYear=false
end if
end function
asp下闰年计算方法_asp技巧
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » asp下闰年计算方法_asp技巧
相关推荐
- 暂无文章
