function renderTime(){
var currentTime() = new Date();
var Diem = "AM";
var h = currentTime.getHours();
var m = currentTime.getminutes();
var s = currentTime.getseconds();
if (h == 0) {
h == 12;
} else if (h > 12){
h = h - 12;
diem = "PM";
}
if (h < 10) {
h = "0" + h;
}
if (m < 10) {
m = "0" + m;
}
if (s < 10) {
s = "0" + s;
}
var myclock = document.getElementbyId('clockDisplay');
myclock.textContent = h + ":" + m + ":" + s + " " + diem;
setTimeout('renderTime()',1000);
renderTime();
}