糖糖很涩
2015-07-06 16:37
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>获得年份 </title>
<script type="text/javascript">
var mydate=new Date();
document.write("年份:"+mydate.getFullYear()+"<br/>");
document.write("月份:"+mydate.getMonth()+"<br/>");
document.write("日期:"+mydate.getDay()+"<br/>");
document.write("时:"+mydate.getHours()+"<br/>");
document.write("分:"+mydate.getMinutes()+"<br/>");
document.write("秒:"+mydate.getSeconds());
</script>
</head>
<body>
</body>
</html>
月份的范围在0-11,显示5其实是6月
JavaScript进阶篇
468061 学习 · 21891 问题
相似问题