﻿// JScript File

function startclock()
{
var thetime=new Date();

var nhours=thetime.getHours();
var nmins=thetime.getMinutes();
var nsecn=thetime.getSeconds();
var nday = thetime.getDate();
var nmonth = thetime.getMonth();
var nyear = thetime.getFullYear();

if (nsecn<10)
 nsecn="0"+nsecn;

if (nmins<10)
 nmins="0"+nmins;
 
if (nhours < 10)
    nhours="0"+nhours;

if (nday < 10)
    nday="0"+nday;
        
var st = "st";
st = st.sup();
var nd = "nd";
nd = nd.sup();
var rd = "rd";
rd = rd.sup();
var th = "th";
th = th.sup();

if(nday == 01)
    nday = nday+st;
    else if(nday == 21)
    nday = nday+st;
    else if(nday == 31)
    nday = nday+st;
else if(nday == 02)
    nday = nday+nd;
    else if(nday == 22)
    nday = nday+nd;
else if(nday == 03)
    nday = nday+rd;
    else if(nday == 23)
    nday = nday+rd;
    else nday=nday+th;
        
if(nmonth<1)
    nmonth="January";
if(nmonth<2)
    nmonth="February";
if(nmonth<3)
    nmonth="March";    
if(nmonth<4)
    nmonth="April";    
if(nmonth<5)
    nmonth="May";    
if(nmonth<6)
    nmonth="June";
if(nmonth<7)
    nmonth="July";    
if(nmonth<8)
    nmonth="August";    
if(nmonth<9)
    nmonth="September";    
if(nmonth<10)
    nmonth="October";
if(nmonth<11)
    nmonth="November";
if(nmonth<12)
    nmonth="December";

document.getElementById('test').innerHTML=nhours+":"+nmins+":"+nsecn+" - "+nday+" "+nmonth+" "+nyear;

setTimeout('startclock()',1000);

} 

