js getTime() to 24 hour format 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: javascript get 24 hour time
var date = new Date();
console.log(date.toLocaleString('en-GB'));