求本月有多少天?

中心思想是:下个月的第0天即为本月的最后一天

var oDate=new Date();
 
oDate.setMonth(oDate.getDate()+1);
oDate.setDate(0);

alert(oDate.getDate());
如果问题,欢迎大家及时指点,一同交流,共同提高
原文地址:https://www.cnblogs.com/wujidns/p/4435245.html