How do I get the current date in JavaScript? - Stack Overflow

PHOTO EMBED

Fri Jul 26 2024 04:57:21 GMT+0000 (Coordinated Universal Time)

Saved by @mchemlal #javascript

// Try this simple way

const today = new Date();
let date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
console.log(date);
content_copyCOPY

https://stackoverflow.com/questions/1531093/how-do-i-get-the-current-date-in-javascript/28434935