Answers for "time format 12 hour javascript"

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

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;
Posted by: Guest on January-01-2021

Code answers related to "time format 12 hour javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language