I have a script that shows the time on the status bar, but I want the time to show in US standard and not the European standard which it is. I need it to show like 9/01/2002 instead of 1/9/2002 for September 1st, 2002. Can someone point me in the right direction? Here is the code:
<SCRIPT language=JavaScript>
<!--
var timeStr, dateStr;
server = new Date();
client = new Date();
delta= server.getTime() - client.getTime();
function clock() {
now=new Date();
now_server=now.getTime() + delta;
now.setTime(now_server);
//time
hours=now.getHours();
minutes=now.getMinutes();
seconds=now.getSeconds();
timeStr=''+hours;
timeStr+=((minutes<10) ? ':0':':')+minutes;
timeStr+=((seconds<10) ? ':0':':')+seconds;
//date
month=now.getMonth()+1;
date=now.getDate();
year=now.getYear();
if (year<1000) {year = year+1900};
dateStr=''+((date<10) ? '0':'')+date;
dateStr+=((month<10) ? '.0':'.')+month;
dateStr+='.'+year
window.status='Current Time: '+timeStr+' '+dateStr+' ';
Timer=setTimeout('clock()',1000);
}
clock();
//-->
</SCRIPT>
Do me justice, O God, and fight my fight against a faithless people; from the deceitful and impious man rescue me.
Psalm 43:1
<SCRIPT language=JavaScript>
<!--
var timeStr, dateStr;
server = new Date();
client = new Date();
delta= server.getTime() - client.getTime();
function clock() {
now=new Date();
now_server=now.getTime() + delta;
now.setTime(now_server);
//time
hours=now.getHours();
minutes=now.getMinutes();
seconds=now.getSeconds();
timeStr=''+hours;
timeStr+=((minutes<10) ? ':0':':')+minutes;
timeStr+=((seconds<10) ? ':0':':')+seconds;
//date
month=now.getMonth()+1;
date=now.getDate();
year=now.getYear();
if (year<1000) {year = year+1900};
dateStr=''+((date<10) ? '0':'')+date;
dateStr+=((month<10) ? '.0':'.')+month;
dateStr+='.'+year
window.status='Current Time: '+timeStr+' '+dateStr+' ';
Timer=setTimeout('clock()',1000);
}
clock();
//-->
</SCRIPT>
Do me justice, O God, and fight my fight against a faithless people; from the deceitful and impious man rescue me.
Psalm 43:1