javascript取前n天的日期两种方法
方法一:
var d = new Date();
d = new Date(d.getFullYear(),d.getMonth(),d.getDate()-n);
方法二:
var now = new Date();
now.setTime(now.getTime()-n*24*60*60*1000);
方法一:
var d = new Date();
d = new Date(d.getFullYear(),d.getMonth(),d.getDate()-n);
方法二:
var now = new Date();
now.setTime(now.getTime()-n*24*60*60*1000);