Digital Clock HTML for website

Description

  • You can use the following HTML code to create a digital clock on your website that will always display the current time on a page. This 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

Digital Clock - Creating letters

Really like what you have here. Do you also have the code to generate a digital letter or alphabet, looking specifically for 'GMT'

Answer

You can use the same technique I do to create any combination of characters. however, two things: (1) you'd need to create yourself an image for each character you want to use (eg; 'g.gif' 'm.gif' and 't.gif') and (2) you'd need the script to determine what the characters are you will be printing. but you can go like:

<img src="dg8.gif" name="letter1">
<img src="dg8.gif" name="letter2">
<img src="dg8.gif" name="letter3">

<script type="text/javascript">/*<![CDATA[*/
letter1 = 'g';
letter2 = 'm';
letter3 = 't';

// assuming 'g.gif' 'm.gif' and 't.gif' exist
document.letter1.src = letter1+'.gif';
document.letter2.src = letter2+'.gif';
document.letter3.src = letter3+'.gif';
/*]]>*/</script>

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.