js获取几天前的日期
getTime(diff) { var nowdate = new Date() if (diff) { nowdate.setDate(nowdate.getDate() + diff) } var year = nowdate.getFullYear() var month = nowdate.getMonth() + 1 < 10 ? '0' + (nowdate.getMonth() + 1) : nowdate.getMonth() + 1 var day = nowdate.getDate() < 10 ? '0' + nowdate.getDate() : nowdate.getDate() return year + month + day }
越努力越幸运~ 加油ヾ(◍°∇°◍)ノ゙