var currenttime = 'November 23, 2017 18:52:05' //PHP method of getting server date ///////////Stop editting here///////////////////////////////// var montharray=new Array("Ian","Feb","Mar","Apr","Mai","Iun","Iul","Aug","Sep","Oct","Noi","Dec") var dayarray=new Array("Duminica","Luni","Marti","Miercuri","Joi","Vineri","Sambata") var serverdate=new Date(currenttime) function padlength(what){ var output=(what.toString().length==1)? "0"+what : what return output } function displaytime(){ serverdate.setSeconds(serverdate.getSeconds()+1) var datestring=dayarray[serverdate.getDay()]+", "+(serverdate.getDate())+" "+montharray[serverdate.getMonth()]+" "+serverdate.getFullYear() var timestring=padlength(serverdate.getHours())+":"+padlength(serverdate.getMinutes())+":"+padlength(serverdate.getSeconds()) document.getElementById("servertime").innerHTML=""+datestring+"
"+timestring+"
" } window.onload=function(){ setInterval("displaytime()", 1000) }