// Get today's date
let today = new Date();
today.setUTCHours(0, 0, 0, 0);
let isoDate = today.toISOString().substring(0, 10);
console.log(isoDate);
Result:
2023-04-18
My Notebook
// Get today's date
let today = new Date();
today.setUTCHours(0, 0, 0, 0);
let isoDate = today.toISOString().substring(0, 10);
console.log(isoDate);
Result:
2023-04-18