一.获得当前日期
let now = new Date();
二.获得3天后的日期
let now =new Date(); let now2 =new Date(now); now2.setDate( now.getDate()+3 );
三.格式化日期
let now = new Date(); let time = now.getFullYear() + "-" + ((now.getMonth() + 1) < 10 ? "0" : "") + (now.getMonth() + 1) + "-" + (now.getDate() < 10 ? "0" : "") + now.getDate();