HTML Digital Clock for website

Description

  • HTML and Javascript code to create a digital clock on your website that will always display the current time on a page. Each digit for the clock is image based.

Steps

  1. Save the number images and stick them in the same directory as the page. (you can also download a zip file of everything)
  2. Copy and Paste the Source Code into your HTML page.
  3. You are welcome to use your own images for this. Just be sure the image names are the same as the ones used here.
  4. For those of you looking for more, there is also 24 Hour Version and a Time Zone offset version (change the tzOffset variable), and a date version (date version can be combined with a time version).




Source Code


Numbers to save: (or zip of files)

Comments

You need to add the following line to make the clock 30 mins ahead:
d.setMinutes(d.getMinutes() + 30);If you want the time to be exactly 30 mins from whatever the local time is, add it right under
d = new Date();

if you're changing the "Time Zone offset version" you should add it right under this instead:
d.setHours(d.getHours() + tzOffset);

Hello! I was having the roughest time trying to find free digital-looking numbers, and was ecstatic when I finally found this site. Would you happen to be able to upload (or send to me) bigger images though? I need images around 48 X 72 pixels. Either way, I appreciate it.

I personally don't have any other digit images. But as long as the images have the same file names (eg; "dg8.gif" for the "8"), any images can be used.

well, I try this attached to my website with php coding, and it works! :D but the problem is the table is expanded so large and didnt same as yours, is this because of my fault or maybe there's a relational to my css?
thanks

Sounds right. You probably have some CSS that is setting the table or td cell width to 100%. Assuming your using the same size images, you should be able to go:
<table cellpadding="5" style="width:130px;"><td bgcolor="black" style="width:130px;">
and that should fix the problem.