Answers for "js get current time 24 hours"

4

js get time in am

var time = new Date();
console.log(
  time.toLocaleString('en-US', { hour: 'numeric', hour12: true })
);
Posted by: Guest on April-28-2020
0

javascript get 24 hour time

var date = new Date();
console.log(date.toLocaleString('en-GB'));
Posted by: Guest on November-08-2020
0

javascript get 24 hour time

var options = { hour12: false };
console.log(date.toLocaleString('en-US', options));
Posted by: Guest on November-08-2020

Code answers related to "js get current time 24 hours"

Code answers related to "Javascript"

Browse Popular Code Answers by Language