I have written this
JS for a World Clock display
Code:
var el = 0;
function RefreshClock()
{
if(el)
{
clearTimeout(el);
el = 0;
}
getTheDate(null);
el = setTimeout("RefreshClock()", 111000);
}
function StartClock()
{
el = setTimeout("RefreshClock()", 500);
}
function StopClock()
{
if(el)
{
clearTimeout(el);
el = 0;
}
}
function getTheDate(GMToffset)
{
var orgdate=new Date();
var year=orgdate.getYear();
if (year < 1000)
year+=1900;
var day=orgdate.getDay();
var month=orgdate.getMonth();
var daym=orgdate.getDate();
if (daym<10)
daym="0"+daym;
var dayArr=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var monthArr=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var time = document.getElementById("time");
var theDate = new Date();
var frmtedDate = theDate.getHours();
var GMTchange;
if ((GMToffset!="0")&&(GMToffset!=null))
{
var oprtor = GMToffset.slice(0,1);
if(GMToffset.length>2)
{
GMTchange = GMToffset.slice(1,3);
}
else
{
GMTchange = GMToffset.slice(1,2);
}
var preFrmtedDate = theDate.getHours();
if(oprtor=="-")
{
frmtedDate = Number(parseFloat(preFrmtedDate)-parseFloat(GMTchange));
}
else if(oprtor=="+")
{
frmtedDate = Number(parseFloat(preFrmtedDate)+parseFloat(GMTchange));
}
}
var theMinuten = theDate.getMinutes();
if(parseFloat(frmtedDate)>24)
{
day = day+1;
daym = daym+1;
frmtedDate = parseFloat(frmtedDate)-24;
}
if(frmtedDate<10)
{
frmtedDate = "0"+frmtedDate;
frmtedDate = parseFloat(frmtedDate);
}
if(parseFloat(theMinuten)<10)
{
theMinuten = "0"+theMinuten;
theMinuten = parseFloat(theMinuten);
}
time.innerHTML = frmtedDate;
time.innerHTML = time.innerHTML + "." + theMinuten + " " + dayArr[day] + ", " + monthArr[month] + " " + daym + ", " + year;
}
this is my table display...
Code:
<table width="750px" border="0" cellpadding="0" cellspacing="2" >
<tr>
<td height="18" colspan="8" bgcolor="<%=headerCol%>"><table width="100%" border="1" bordercolor="<%=headerBrd%>" cellpadding="0" cellspacing="0">
<tr>
<td align="center" bordercolor="<%=headerCol%>" valign="top"><img border="0" src="/v2/asp/images/picco.gif"></td>
<td bordercolor="<%=headerCol%>" valign="bottom" ><table align="right">
<tr>
<td id="location"><select name="cities" id="cities" class="selects" onchange="getTheDate(this.options[this.selectedIndex].value);">
<option value="0">London</option>
<option value="-5">New York</option>
<option value="+1">Paris</option>
<option value="-8">Los Angeles</option>
<option value="+9">Sydney</option>
<option value="+8">Singapore</option>
<option value="+13">Auckland</option>
</select>
</td>
<td id="time"></td>
</tr>
</table></td>
</tr>
</table>
i was wondering if there is some code that you can see that will make it go back a day?? if you know what i mean
www.crmpicco.co.uk