倒推天数的算法
//times 为 number timer: function(times) { var today = new Date(); var Days = new Date(); Days.setDate(today.getDate() - times); Years = Days.getFullYear(); Months = (Days.getMonth() + 1) > 9 ? (Days.getMonth() + 1) : "0"+(Days.getMonth() + 1); Dayer = Days.getDate() > 9 ? Days.getDate() : "0"+Days.getDate(); return parseInt(Years + "" + Months + "" + Dayer); } //输出的格式为 : YYYYMMDD