Hi
I need to display the date/time in various places on my website page, I have some script that should work but does not for some reason.
I created a fiddle for you to see test etc.
[URL="https://jsfiddle.net/0rbtugjo/3/[/URL]
Script is:
And basic html isCode:<script type="text/javascript"> function GetClock(){var d=new Date();var nmonth=d.getMonth(),ndate=d.getDate(),nyear=d.getFullYear();var nhour=d.getHours(),nmin=d.getMinutes();if(nmin<=9) nmin="0"+nmin var obj=document.querySelectorAll('.privclock);for(var i in obj){obj[i].innerHTML=""+ndate+"/"+(nmonth+1)+"/"+nyear+" "+nhour+":"+nmin+"";} window.onload=function(){GetClock();setInterval(GetClock,1000);}</script>rgds, SimonCode:<div class="privclock"></div>



Reply With Quote

Bookmarks