How To Insert Digital Date and Time In Blogger ?

Digital Date and Time In Blogger 


Open the layout section. Click on Add a Gadget option where you want to show the digital date and time. 

Click on the HTML / JavaScript option and paste the code below which is Blue in color.

                                 

tday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
tmonth=new Array("January","February","March","April","May","June","July","August","September","October","November","December");

function GetClock(){
var d=new Date();
var nday=d.getDay(),nmonth=d.getMonth(),ndate=d.getDate(),nyear=d.getFullYear();
var nhour=d.getHours(),nmin=d.getMinutes(),nsec=d.getSeconds(),ap;

if(nhour==0){ap=" AM";nhour=12;}
else if(nhour<12){ap=" AM";}
else if(nhour==12){ap=" PM";}
else if(nhour>12){ap=" PM";nhour-=12;}

if(nmin<=9) nmin="0"+nmin;
if(nsec<=9) nsec="0"+nsec;

document.getElementById('clockbox')=""+tday[nday]+", "+tmonth[nmonth]+" "+ndate+", "+nyear+" "+nhour+":"+nmin+":"+nsec+ap+"";
}

=function(){
GetClock();
setInterval(GetClock,1000);
}

<div id="clockbox"></div>

Paste this code in HTML/JavaScript box and then save it.
Refresh the window, Now you will see Digital Date & Time shows present Date & Time.

Please consider sharing it with your friends on social media, and don’t forget to follow RAVIEDU on YouTubeTwitter, and Linkedin.


Post a Comment

1 Comments

Please do not entre any spam link in the comment box.