摘要:<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0">&
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>获取时间年月日</title>
</head>
<body>
<script>
var myDate= new Date();
document.write(myDate+"<hr>");
document.write("当前时间是:北京时间 "+myDate.getFullYear()+"年");
// y=myDate.getMonth()
// document.write(y+1+"月");
document.write(myDate.getMonth()+1+"月");
document.write(myDate.getDate()+"日");
document.write("星期"+myDate.getDay());
document.write(myDate.toLocaleTimeString());
</script>
</body>
</html>
批改老师:天蓬老师批改时间:2019-01-25 15:16:36
老师总结:最常用的时间戳, 你没有写出来, 课后练习一下