I am new to coding and need a little help. I found a clock javascript and I am trying to change the time format to the 12-hour format. How can I modify the code below to run on the 12-hour format?
function updateTime(){
var currentTime = new Date()
var hour = pad( currentTime.getHours(), 2);
var minutes = pad( currentTime.getMinutes(), 2);
var hour_1 = hour.substr(0,1);
var hour_2 = hour.substr(1,2);
var minute_1 = minutes.substr(0,1);
var minute_2 = minutes.substr(1,2);
Thanks in advance for any help/comments.