//计算当前天的n天前 var yugi = function(n){ var now = new Date; now.setDate(now.getDate() - n); return now; }