JS 在获取当前月的最后一天

获取上个月最后一天,只需要设置SetDate参数为0 

var endDate = new Date();
//上个月最后一天
endDate.setDate(0)
 let limitdate = new Date()
 limitdate.setMonth(limitdate.getMonth()+6);
 let lastDay = limitdate.setDate(0);//往后5个月的最后一天 取下个月的第一天 然后减去一天

 往后5个月的最后一天 

猜你喜欢

转载自blog.csdn.net/meetlunay/article/details/102497518
今日推荐