let d = new Date(2022, 2, 21, 7, 45, 0);
let s = d.toLocaleString([], { dateStyle: 'short', timeStyle: 'short' });
console.log(s);
// '2/21/22, 7:45 AM'
var dateWithoutSecond = new Date();
dateWithoutSecond.toLocaleTimeString([], {year: 'numeric', month: 'numeric', day: 'numeric', hour: '2-digit', minute: '2-digit'});