javascript get if time is 24 hour or 12 hour code example
Example 1: javascript get 24 hour time
var date = new Date();
console.log(date.toLocaleString('en-GB'));
Example 2: javascript get 24 hour time
var options = { hour12: false };
console.log(date.toLocaleString('en-US', options));