var now = new Date(); //当前日期
var nowMonth = now.getMonth(); //当前月
var nowYear = now.getFullYear(); //当前年
var monthEndDate = new Date(nowYear, nowMonth+1, 0,23,59,59);//本月最后一天
var timeEnd=Date.parse(monthEndDate)/1000;//本月最后一天时间戳
var nextmonth = new Date(nowYear, nowMonth+1+1, 0,23,59,59);//次月最后一天
var nextendtime=Date.parse(nextmonth)/1000;//本月最后一天时间戳
var today=(Date.parse(new Date()))/1000;//当前时间戳
var months=now.getMonth();
if (months == 11){
now.setMonth(0)
}else{
now.setMonth(Number(months) + 1);
}
console.log(now.setMonth(Number(months) + 1));
now.setDate(1);
now.setHours(0);
now.setSeconds(0);
now.setMinutes(0);
var nextfirstday=parseInt((now.getTime())/1000);//下个月的0点时间戳
获取本月最后一天23:59:59和次月的最后一天23:59:59的时间戳 var now = new Date(); //当前日期 var nowMonth = now.getMonth(); //当前月 var nowYear = now.getFullYear(); //当前年 var monthEndDate = new Date(nowYear, nowMonth+1, 0,23,59,59