PDA

View Full Version : HTML code help



sunny152
05-31-2007, 08:21 AM
Hi Everybody,
I have downloaded digital clock code from http://clocklink.com
It displays date as follows- 31st/may/07 thurs 07:13:35 p.m
So,now i wan't to modify the HTML by removing time and to display only date/month/year/week as- 31st/may/07 thurs
So,please let me know how to modify this HTML Code.The code is

<script src="<A href="http://www.clocklink.com/embed.js"></script><script">http://www.clocklink.com/embed.js"></script><script type="text/javascript" language="JavaScript">obj = new Object;obj.clockfile = "5004-green.swf";obj.TimeZone = "NZT";obj.width = 192;obj.height = 16;obj.Place = "";obj.DateFormat = "d / MMM / yy DDD";obj.TimeFormat = "hh:mm:ss TT";obj.wmode = "transparent";showClock(obj);</script>


Thanks,
SUNNY.

navaldesign
05-31-2007, 12:06 PM
I can't see your clock (i miss the swf file). For a simple clock, use this code:

<form name=myForm>
<input type=text style="position:absolute;width:180px;border:1px #000080 solid;background-color:#E1F1FF;color:#000080;font-family:Arial;font-size:12 "value="Loading..." name=clock></form>
<SCRIPT LANGUAGE="JavaScript"><!--
function runClock(){
theTime = window.setTimeout("runClock()", 1000);
d = new Date();
day = d.getDay();
mon = d.getMonth();
date = d.getDate();
year = d.getYear();
hr = d.getHours();
min = d.getMinutes();
sec = d.getSeconds();
if(year<1000){year=(""+(year+11900)).substring(1,5 );}
else{year=(""+(year+10000)).substring(1,5);}
if(hr==0){ap=" AM";hr=12}
else if(hr <= 11){ap=" AM"}
else if(hr == 12){ap=" PM";hr=12}
else if(hr >= 13){ap=" PM";hr-=12}
if(min <= 9){min="0"+min}
if(sec <= 9){sec="0"+sec}
zday=new Array();
zday=["Sunday","Monday","Tuesday","Wednesday","Thursday" ,"Friday","Saturday"];
zmon=new Array();
zmon=["January","February","March","April","May","June", "July","August","September","October","November"," December"];
document.myForm.clock.value=""+zday[day]+", "+zmon[mon]+" "+date+", "+year+" ";}
runClock();
//--></script>

Paste it in a HTML box in your page. You can also change the text formatting, color etc as well as the dimensions of the box, by chaning the parts in red.

For your own code try:

<script src="<A href="http://www.clocklink.com/embed.js"></script><script">http://www.clocklink.com/embed.js"></script><script type="text/javascript" language="JavaScript">obj = new Object;obj.clockfile = "5004-green.swf";obj.TimeZone = "NZT";obj.width = 192;obj.height = 16;obj.Place = "";obj.DateFormat = "d / MMM / yy DDD";obj.wmode = "transparent";showClock(obj);</script>