I need to get the date of constantly changing two weeks back so from today two weeks back in YYYY-MM-DD format. I got it with this code snippet that works, but is there a better way?
Thanks!!!
const twoWeeksBack = new Date(Date.now() - 12096e5).toISOString().slice(0, 10);
console.log(twoWeeksBack);