convert time to 12 hour format javascript code example
Example 1: javascript conver time into 24 hour format
var dt = moment("12:15 AM", ["h:mm A"]).format("HH:mm");
Example 2: how to conver time format to 12 hours in javascript
var hours = dt.getHours()
minute = dt.getMinutes();
hours = (hours % 12) || 12;
console.log("Time is - " + hours + ":" + minure;