📜  反应获取当前日期减去 7 天 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:16.787000             🧑  作者: Mango

代码示例1
let today = new Date();
today.setDate(today.getDate() - 7);
let date = new Date(today).toLocaleDateString("de");

// e.g. today = 3.02.2021
// date will be "27.01.2021"