JS 今天/明天的日期

//今天的日期
var today = new Date();
today.setTime(today.getTime());
var todayStr = today.getFullYear()+"-" + (today.getMonth()+1) + "-" + today.getDate();
//明天的日期
var tomorrow = new Date();
tomorrow.setTime(tomorrow.getTime() + 24*60*60*1000);
var tomorrowStr = tomorrow.getFullYear()+"-"+(tomorrow.getMonth()+1)+"-"+tomorrow.getDate();

猜你喜欢

转载自www.cnblogs.com/wssdx/p/12946047.html