epiz_24820641
Not getting an error message however, when the results are displayed, The day is showing up wrong. All other variables are listed correctly. I have tested this on multiple machines.
I am using the java function below:
window.onload = function() {
clock();
function clock() {
var now = new Date();
var TwentyFourHour = now.getHours();
var hour = now.getHours();
var min = now.getMinutes();
var sec = now.getSeconds();
var mid = ‘pm’;
var year = now.getFullYear();
var month = now.getMonth();
var day = now.getDay();
if (month = 1) {
month = “January”;
}
if (month = 2) {
month = “February”;
}
if (month = 3) {
month = “March”;
}
if (month = 4) {
month = “April”;
}
if (month = 5) {
month = “May”;
}
if (month = 6) {
month = “June”;
}
if (month = 7) {
month = “July”;
}
if (month = 8) {
month = “August”;
}
if (month = 9) {
month = “September”;
}
if (month = 10) {
month = “October”;
}
if (month = 11) {
month = “November”;
}
if (month = 12) {
month = “December”;
}
if (sec < 10) {
sec = “0” + sec;
}
if (min < 10) {
min = “0” + min;
}
if (hour > 12) {
hour = hour - 12;
}
if(hour==0){
hour=12;
}
if(TwentyFourHour < 12) {
mid = ‘am’;
}
document.getElementById(‘currentTime’).innerHTML = “”+month+" “+day+”, “+year+”
“+hour+‘:’+min+‘:’+sec +’ '+mid+”" ;
setTimeout(clock, 1000);
}
}