js获取当月的最后一天
以下就是JS代码::
@ author YHC:
[javascript]
function getCurrentMonthLastDay(){
var current=new Date();
var currentMonth=current.getMonth();
var nextMonth=++currentMonth;
var nextMonthDayOne =new Date(current.getFullYear(),nextMonth,1);
var minusDate=1000*60*60*24;
return new Date(nextMonthDayOne.getTime()-minusDate);
}
function getCurrentMonthLastDay(){
var current=new Date();
var currentMonth=current.getMonth();
var nextMonth=++currentMonth;
var nextMonthDayOne =new Date(current.getFullYear(),nextMonth,1);
var minusDate=1000*60*60*24;
return new Date(nextMonthDayOne.getTime()-minusDate);
}
[javascript]
function getCurrentMonthFirstDay(){
var current=new Date();
current.setDate(1);
return current;
}
function getCurrentMonthFirstDay(){
var current=new Date();
current.setDate(1);
return current;
}
作者:yhc13429826359
补充:web前端 , JavaScript ,