javascript get current time in 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: get current time in js
<script>
var today = new Date();
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
</script>
Example 3: javascript get 24 hour time
var date = new Date();
console.log(date.toLocaleString('en-GB'));
Example 4: javascript get 24 hour time
var options = { hour12: false };
console.log(date.toLocaleString('en-US', options));