Home > Web Front-end > JS Tutorial > JS implementation code to obtain the number of days of the month based on the year and month_javascript skills

JS implementation code to obtain the number of days of the month based on the year and month_javascript skills

WBOY
Release: 2016-05-16 16:42:35
Original
1216 people have browsed it
function getDaysInMonth(year,month){ 
month = parseInt(month,10); //parseInt(number,type)这个函数后面如果不跟第2个参数来表示进制的话,默认是10进制。 
var temp = new Date(year,month,0); 
return temp.getDate(); 
}
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template