<!DOCTYPE html><html><head><meta charset="utf-8"> <title>Time</title> <script type="text/javascript"> window.onload=function () { showTime(); } function showTime() { var mDate = new Date(); var year=mDate.getFullYear(); var month=mDate.getMonth()+1; var date=mDate.getDate(); var h=mDate.getHours(); var s=mDate.getSeconds(); var m=mDate.getMinutes(); var week=mDate.getDay(); var weeks=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]; var text=document.getElementById('timeText'); text.innerHTML=year+"年"+month+"月"+date+"日"+weeks[week]+h+":"+m+":"+s; setTimeout(showTime,500); } </script></head><body><input type="text" id="timeText" style="margin-top: 20px"></body></html>
添加回答
举报
0/150
提交
取消