function getDaysInMonth(year,month){
month = parseInt(month,10); //parseInt(number,type)这个函数后面如果不跟第2个参数来表示进制的话,默认是10进制。
var temp = new Date(year,month,0);
return temp.getDate();
}
最后
以上就是漂亮蜗牛最近收集整理的关于JS根据年月获得当月天数的实现代码的全部内容,更多相关JS根据年月获得当月天数内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复