Digital Clock

Written by @kerixa 23 February 2014

Have a nice digital clock in your page. This code will show time dynamically in your page. Note that you must download the images and insert it in the proper path.

Code Snippet:

                                                
                                                <!-- this script is provided by www.htmlbestcodes.com coded by: Kerixa Inc. -->
<!-- this script got from www.htmlbestcodes.com-Coded by: Krishna Eydat -->
<table cellpadding="5"><td bgcolor="black">
<img src="/images/dg_clock/dg8.gif" name="hr1"><img 
src="/images/dg_clock/dg8.gif" name="hr2"><img 
src="/images/dg_clock/dgc.gif"><img 
src="/images/dg_clock/dg8.gif" name="mn1"><img 
src="/images/dg_clock/dg8.gif" name="mn2"><img 
src="/images/dg_clock/dgc.gif"><img 
src="/images/dg_clock/dg8.gif" name="se1"><img 
src="/images/dg_clock/dg8.gif" name="se2"><img 
src="/images/dg_clock/dgpm.gif" name="ampm"></td></table>

<script type="text/javascript">
// (c) 2000-2009 ricocheting.com

dg0=new Image();dg0.src="/images/dg_clock/dg0.gif";
dg1=new Image();dg1.src="/images/dg_clock/dg1.gif";
dg2=new Image();dg2.src="/images/dg_clock/dg2.gif";
dg3=new Image();dg3.src="/images/dg_clock/dg3.gif";
dg4=new Image();dg4.src="/images/dg_clock/dg4.gif";
dg5=new Image();dg5.src="/images/dg_clock/dg5.gif";
dg6=new Image();dg6.src="/images/dg_clock/dg6.gif";
dg7=new Image();dg7.src="/images/dg_clock/dg7.gif";
dg8=new Image();dg8.src="/images/dg_clock/dg8.gif";
dg9=new Image();dg9.src="/images/dg_clock/dg9.gif";
dgam=new Image();dgam.src="/images/dg_clock/dgam.gif";
dgpm=new Image();dgpm.src="/images/dg_clock/dgpm.gif";

function dotime(){ 
theTime=setTimeout('dotime()',1000);
d = new Date();
hr= d.getHours()+100;
mn= d.getMinutes()+100;
se= d.getSeconds()+100;
if(hr==100){hr=112;am_pm='am';}
else if(hr<112){am_pm='am';}
else if(hr==112){am_pm='pm';}
else if(hr>112){am_pm='pm';hr=(hr-12);}
tot=''+hr+mn+se;
document.hr1.src = '/images/dg_clock/dg'+tot.substring(1,2)+'.gif';
document.hr2.src = '/images/dg_clock/dg'+tot.substring(2,3)+'.gif';
document.mn1.src = '/images/dg_clock/dg'+tot.substring(4,5)+'.gif';
document.mn2.src = '/images/dg_clock/dg'+tot.substring(5,6)+'.gif';
document.se1.src = '/images/dg_clock/dg'+tot.substring(7,8)+'.gif';
document.se2.src = '/images/dg_clock/dg'+tot.substring(8,9)+'.gif';
document.ampm.src= '/images/dg_clock/dg'+am_pm+'.gif';
}
dotime();

</script>
<div><a target="_blank" href="http://www.htmlbestcodes.com/"><span style="font-size: 8pt; text-decoration: none">HTML Best Codes</span></a></div><a target='_blank' href='www.htmlbestcodes.com' style='font-size: 8pt; text-decoration: none'>Html Best Codes</a>                                                
                                            

Example:


About @kerixa

I am Krishna Eydat. I studied Software Engineering at University of Waterloo in Canada. I lead a few tech companies. I am passionate about the way we are connected. I would like to be part of something big or be the big deal!

K
TRENDING POST
1
2
3
4
5
VISITORS
Online Users: 12
Recent Members: Nikhil 999+, bishalthakur
advertisement 2