|
         On the given page JavaScript is located, with help of which the current date and time are deduced in a line of a condition.          Text of JavaScript:
function TimeFunction() {
var now;
var strng, day;
now=new Date();
dte=now.getDate();
if (dte<10) { dte="0"+dte;}
mnth=now.getMonth()+1;
if (mnth<10) { mnth="0"+mnth;}
strng=dte+"-"+mnth+"-"+(now.getYear())+",";
switch(now.getDay()) {
case 0: day="Sunday";break;
case 1: day="Monday";break;
case 2: day="Tuesday";break;
case 3: day="Wednesday";break;
case 4: day="Thursday";break;
case 5: day="Friday";break;
case 6: day="Saturday";break;}
hrs=now.getHours();
if (hrs<10) { hrs="0"+hrs;}
min=now.getMinutes();
if (min<10) { min="0"+min;}
sec=now.getSeconds();
if (sec<10) { sec="0"+sec;}
strng=strng+" "+day+" "+hrs+":"+min+":"+sec;
window.status=strng;
return strng;
}
var d;
d=TimeFunction();
window.setInterval("d=TimeFunction()",1000);
The given function is carried out for once in a second. It is provided with the help of a method window.setInterval(A,B,[C]), where:
|
|
Main    Animation:
|