<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Js内置对象之Date对象</title>
<script>
/*
js中的Date对象的创建格式
var 对象名=new Date();
*/
var date=new Date();
document.write(date);
//获取年份
document.write(date.getYear());//获取当前年份和1990年之间的差距
document.write("<br/>")
//使用getFulYear():获取年份
document.write((date.getFullYear())+"年");
//使用getMonth获取月份
document.write((date.getMonth()+1)+"月");
//获取具体的日期
document.write((date.getDate())+"日");
document.write("<hr/>");
//时
document.write(date.getHours()+":");
//分
document.write(date.getMinutes()+":");
//秒
document.write(date.getSeconds());
</script>
</head>
<body>
</body>
</html>