I have a Date object and I\'d like to display it in the below format:
var myDate = getDate(); // this format: \"13 Jan 2012 11:00am\";
How
Use 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'