<!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>JavaScript对象</title>
<script>
var date= new Date();
document.write("now it's"+ date.getFullYear()+"年"+(date.getMonth()+1)+"月"+date.getDate()+"日 ");
var day = date.getDay();
switch(day){
case 0:
d = "Sunday";
break;
case 1:
d = "Monday";
break;
case 2:
d = "Tuesday";
break;
case 3:
d = "Wednesday";
break;
case 4:
d = "Thursday";
break;
case 5:
d = "Friday";
break;
default:
d = "Saturday";
}
document.write(d+" ");
if(date.getHours()<10){
document.write("0");
}
document.write(date.getHours()+":");
if(date.getMinutes()<10){
document.write("0");
}
document.write(date.getMinutes()+":");
if(date.getSeconds()<10){
document.write("0");
}
document.write(date.getSeconds());
</script>
</head>
<body>
</body>
</html>
行走的指尖
Sorry灬D
相关分类