在 ASP 中对日期进行加运算后,出现: NaN-NaN-NaN 值
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<script language="JavaScript">
<!-- Begin
var enable=0;
today=new Date();
var day;
var date;
var time_start = new Date();
var clock_start = time_start.getTime();
if(today.getDay()==0) day="星期日"
if(today.getDay()==1) day="星期一"
if(today.getDay()==2) day="星期二"
if(today.getDay()==3) day="星期三"
if(today.getDay()==4) day="星期四"
if(today.getDay()==5) day="星期五"
if(today.getDay()==6) day="星期六"
date=(today.getYear())+"年"+(today.getMonth()+1)+"月"+today.getDate()+"日 ";
document.write("<span style='font-size: 9pt;color:#000000;'>"+date);
document.write(day+"</font></span>");
// -->
</script>
<script language="JavaScript">
function autoje(){
if (form1.days.value==0)
{alert("请输入天数!");form1.days.focus();return;}
if (isNaN(form1.days.value))
{alert("您输入的不是有效值(请输入0-9之间的数)!");form1.days.focus();return;}
;}
</script>
<script language="JavaScript">//在原有的日期中先加10天,然后date2输出加10天后的日期
function changeDate() {
var offset = form1.days.value;
var dateStrA = form1.date1.value;
var year = dateStrA.substring(0,4);
var month = Number(dateStrA.substring(5,7))-1;
var date = Number(dateStrA.substring(8,10))+offset;
var dateB = new Date();
dateB.setFullYear(year,month,date);
var year2 = dateB.getFullYear();
var month2 = (dateB.getMonth()+1)+"";
var date2 = dateB.getDate()+"";
if (month2.length == 1) month2 = "0"+month2;
if (date2.length == 1) date2 = "0"+date2;
form1.date2.value = year2 + "-" + month2 + "-" + date2;}
</script>
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<p>a
<label>
<input name="date1" type="text" id="date1" />
</label>
</p>
<p>b
<label>
<input name="days" type="text" id="days" onblur="changeDate()" size="13" onkeyup="if(event.keycode==13){changeDate()}" />
</label>
</p>
<p>
<label>
<input name="date2" type="text" id="date2" />
</label>
</p>
<p>
<label>
<input type="submit" name="Submit" value="提交" />
</label>
</p>
</form>
</body>
</html>
但是运行后DATE2出现:NaN-NaN-NaN
请帮查看原因。