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
Save the number images and stick them in the same directory as the page. (you can also download a zip file of everything)
Copy and Paste the Source Code into your HTML page.
You are welcome to use your own images for this. Just be sure the image names are the same as the ones used here.
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).
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.
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);
Comments
Thanks!
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.
Digital Numbers
Try this and see if these are scalable
http://blogs.msdn.com/b/xdesignsupport/archive/2008/04/18/digital-number...
Answer
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.
Coding for 30 minute time different timezones
Tried to create a timezone that is not an hour different but 30 mins different. Any help with code please
Thanks Danny
Answer
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 underd = new Date();if you're changing the "Time Zone offset version" you should add it right under this instead:
d.setHours(d.getHours() + tzOffset);