How to display a Date object in a specific format using JavaScript?
https://stackoverflow.com/questions/9532664/how-to-display-a-date-object-in-a-specific-format-using-javascript
WEBMar 2, 2012 · 6 Answers. Sorted by: 31. Use the build-in toLocaleString () const date = new Date(); const formattedDate = date.toLocaleString("en-GB", { day: "numeric", month: "short", year: "numeric", hour: "numeric", minute: "2-digit" }); console.log(formattedDate); // '18 Jan 2020, 18:20' edited Oct 6, 2021 at 14:01.
DA: 9 PA: 94 MOZ Rank: 84