我遇到一个问题了,非常基础的,希望大神们能指点一下,不胜感激
关于显示时间的,下面的日期显示不出来
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>date对象</title>
<SCRIPT language="javaScript">
function disptime()
{
var now=new Date();
var hour=now.getHours();
if(hour>=0&&hour<=12)
document.write("<h2>上午好!</h2>")
if(hour>12&&hour<=18)
document.write("<h2>下午好!</h2>");
if(hour>18&&hour<24)
document.write("<H2>晚上好!</H2>");
document.write("<H2>今天的日期:"+now.getYear()+"年"+(now.getMonth()+1)+"月"+now.getDate()+"日</H2>");
document.write("<H2>现在时间:"+now.getHours()+"点"+now.GetMinutes()+"分</H2>");
}
</script>
</head>
<body onload="disptime()">
</body>
</html>