I'm using moment.js for formatting date and time with format function, I'm getting correct output for date but whereas time is setting to 12:00 AM for all times by default. What ever time I give for below code it sets to 12:00 AM. Is there way to fix it?
console.log(moment('2020-10-22 11:00:00', 'YYY-MM-DD').format('MMM DD - h:mm A'))
//Received output: Oct 22 - 12:00 AM
//Expected output: Oct 22 - 11:00 AM