Canada's Premier Web Hosting & Domain Registration Service! 


   

Navigation for

this site

requires that

JAVA be

Enabled.

 

 

Control Panel/Webmail Log in



Enter your domain name and choose Login to your control panel or Webmail
Forget Your Password?

Search


 
 

We accept the following forms of payment as well as paypal & cheque

Add a clock to your website

This page will allow you to add a little clock to your site. Rule number one: You do not need to know anything about JavaScript to do this. You're just going to cut stuff, and paste it into the HTML of your web site. The results look like:

The first part you're going to need is the script that is hidden from view that does all the thinking. Then there are two parts that show the results.

Part I: The Script

Yes, all that stuff in the box below is giberish. The question is, is giberish a word? Anyway, the important thing is that you don't have to think about it or know what it means. What you have to be able to do, is cut it and paste it into your HTML. Do that and you're done with part one.

Cut and paste the script below into your HTML


<script language="JavaScript" type="text/JavaScript">
function initArray() {
for(i=0;i<initArray.arguments.length; i++)
this[i] = initArray.arguments[i];
}
var isnMonths=new initArray("JANUARY","FEBRUARY","MARCH",
"APRIL","MAY","JUNE",
"JULY","AUGUST","SEPTEMBER",
"OCTOBER","NOVEMBER","DECEMBER");
var isnDays= new initArray("Sun","Mon","Tue","Wed",
"Thu","Fri","Sat","Sun");
today=new Date();
hrs=today.getHours();
min=today.getMinutes();
sec=today.getSeconds();
clckh=""+((hrs>12)?hrs-12:hrs);
clckm=((min<10)?"0":"")+min;
clck=(hrs>=12)?"PM":"AM";

var stnr="";
var ns="0123456789";
var a="";

function getFullYear(d) { // d is a date object
yr = d.getYear();
if (yr < 1000)
yr+=1900;
return yr;
}
</script>

 

Part II: The Calls

The next two parts are, the date () and the time ( EST). Again, don't think about it, just paste either or both some time after the first part and you're done.

Date Script -


<script>document.write(" "+isnDays[today.getDay()]+", "+isnMonths[today.getMonth()]+" "+today.getDate()+", "+getFullYear(today)+"");</script>

 

Clock Script -


<script>document.write(" "+clckh+":"+clckm+" "+clck+" ");</script>

 

You can adjust the local time by adding text that adds or subtracts hours like. For example, to subtract two hours just change "+clckh+" to "+clckh - 2+" in the above example. Now, become !

 

^Back to Top

 

Canada's Premier Web Hosting & Domain Registration Service!

AceOfSpace.com, Website Hosting & Domain Registration

Copyright 2005-2012. AceOfSpace.com and AceOfSpace are service marks of Web Hosting Inc. No part of this site may be used, copied, nor reproduced without written permission from the copyright holder. Updated: 2/2/10 Loaded: 2/07/2012 01:53:25.  Your IP Address is:  38.107.179.243 

Home | Sign Up | Hosting Packages | Documentation | Tutorials | Website Design | Website Templates | Website Marketing | Domain Names | Tech Support | Customer Service | Update Billing Info | Terms of Service