1.获取当前时间的前一天及后一天
1 var curDate = new Date(); 2 var preDate = new Date(curDate.getTime() - 24*60*60*1000); //前一天 3 var nextDate = new Date(curDate.getTime() + 24*60*60*1000); //后一天