I have date in this format "2020-02-07T16:13:38.22" i want to convert this to " d MMMMM yyyy HH:mm a " to this format without using the momentjs.
below method is used to convert the date
const options = {
day: "numeric",
month: "long",
year: "numeric",
}
var date1 = new Date("2020-02-07T16:13:38.22").toLocaleDateString("en-US", options);
const options1 = {
hour12: true,
hour: "numeric",
minute: "2-digit",
}
var date2 = new Date("2020-02-07T16:13:38.22").toLocaleTimeString("en-US", options1);
var res = date1 + ', ' + date2;
console.log(res)
Above code gives the result "February 7, 2020, 4:13 PM" but i need "7 February 2020 4:13 PM" i.e date first then month and year and time and the code which i tried is longer please help me in the required result.