标签:http java os io ar cti html 时间
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
function getTime(){
var myDate = new Date();
var year = myDate.getFullYear();
var month = myDate.getMonth();
var day = myDate.getDay();
var hour = myDate.getHours();
var minutes = myDate.getMinutes();
var seconds = myDate.getSeconds();
document.getElementById("time").innerHTML=year+"年"+month+"月"+day+"日 "+hour+"时"+minutes+"分"+seconds+"秒";
}
setInterval("getTime()",1000);
//document.getElementById("time").innerHTML = 22;
</script>
</head>
<body>
现在时间是:<p id="time"></p>
</body>
</html>
标签:http java os io ar cti html 时间
原文地址:http://www.cnblogs.com/siashan/p/3921221.html