Home > Article > Web Front-end > JS implementation code to obtain the number of days of the month based on the year and month_javascript skills
function getDaysInMonth(year,month){ month = parseInt(month,10); //parseInt(number,type)这个函数后面如果不跟第2个参数来表示进制的话,默认是10进制。 var temp = new Date(year,month,0); return temp.getDate(); }