<head> <title>演示set方法</title> <script language=javascript) <!-- function setDataAll(){ var D=new Data(); var y=D.setYear(2001); var m=D.setMonth(8); var r=D.setData(16); var mass="用setyear..是"+D.toLocaleString()+"\n\r"; var d=new Data(D.setFullYear(2001,8.16)); return(mass+"用setFullYear得"+d.toLocaleString()); } function setTimeAll(){ var T=new Data(); var h=T.setHours(12); var m=T.setMinutes(15); var s=T.setSeconds(24); var c=":"; var mass=T.getHours()+c+T.getMinutes()+c+T.getSeconds(); return(mass); } //main alert(setDataAll()); alert("设定的时间是"+setTimeAll()); //main end //--> </script> </head>