How to format a JavaScript date - Stack Overflow

PHOTO EMBED

Wed Jan 12 2022 19:21:26 GMT+0000 (UTC)

Saved by @yuio #javascript

var options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
var today  = new Date();

console.log(today.toLocaleDateString("en-US")); // 9/17/2016
console.log(today.toLocaleDateString("en-US", options)); // Saturday, September 17, 2016
console.log(today.toLocaleDateString("hi-IN", options)); // शनिवार, 17 सितंबर 2016
content_copyCOPY

https://stackoverflow.com/questions/3552461/how-to-format-a-javascript-date