计算今年还余多少天
function leftDays(){
var today=new Date();
var endYear=new Date(today.getFullYear(),11,31,23,59,59,999);
var msDay=24*60*60*1000;
return Math.round((endYear.getTime()-today.getTime())/msDay);
}
var resultDate=leftDays();
console.log(resultDate);
计算今年还余多少天
最新推荐文章于 2022-10-19 11:15:05 发布