var Today = new Date();
var week, month;
switch (Today.getDay()) {
case 0:
week = "Duminica";
break;
case 1:
week = "Luni";
break;
case 2:
week = "Marti";
break;
case 3:
week = "Miercuri";
break;
case 4:
week = "Joi";
break;
case 5:
week = "Vineri";
break;
case 6:
week = "Sambata";
break;
}
switch (Today.getMonth()) {
case 0:
month = "Ianuarie";
break;
case 1:
month = "Februarie";
break;
case 2:
month = "Martie";
break;
case 3:
month = "Aprilie";
break;
case 4:
month = "Mai";
break;
case 5:
month = "Iunie";
break;
case 6:
month = "Iulie";
break;
case 7:
month = "August";
break;
case 8:
month = "Septembrie";
break;
case 9:
month = "Octombrie";
break;
case 10:
month = "Noiembrie";
break;
case 11:
month = "Decembrie";
break;
}
var timerID = null;
var timerRunning = false;
var timeValue = "";
function stopclock (){
if(timerRunning) clearTimeout(timerID);
timerRunning = false;
}
function showtime () {
var now = new Date();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds()
timeValue = "" + ((hours >12) ? hours -12 :hours)
if (timeValue == "0") timeValue = 12;
timeValue += ((minutes < 10) ? ":0" : ":") + minutes
timeValue += ((seconds < 10) ? ":0" : ":") + seconds
timeValue += (hours >= 12) ? " P.M." : " A.M."
timeValue = week + ", " + month + " " + Today.getDate() + ", " + Today.getYear() + " " + timeValue;
document.getElementById("time").innerHTML = "" + timeValue + "
";
timerID = setTimeout("showtime()",1000);
timerRunning = true;
}
function startclock() {
stopclock();
showtime();
}