1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>JS显示具体日期</title>
6 <script language="javascript">
7 function mm(){
8 var d=new Date();
9 year=d.getFullYear();
10 //year=eval(year+"年");
11 mouth=d.getMonth()+1;
12 mouth=mouth<10?"0"+mouth:mouth;
13 day=d.getDate();
14 day=day<10?"0"+day:day;
15 hours=d.getHours();
16 hours=hours<10?"0"+hours:hours;
17 minutes=d.getMinutes();
18 minutes=minutes<10?"0"+minutes:minutes;
19 seconds=d.getSeconds();
20 seconds=seconds<10?"0"+seconds:seconds;
21
22 //var gg=eval(year)
23 document.form1.c.value=year+"年"+mouth+"月"+day+"日"+hours+":"+minutes+":"+seconds;
24 }
25 setInterval("mm();",1000);
26 </script>
27 </head>
28 <body onload="mm()">
29 <form name="form1">
30 <input type="text" id="c" style="border:none; font-size:50px; width:100%; color:#f00;" />
31 </form><p>大兵制作</p>
32 </body>
33 </html>
34