以文本方式查看主题

-  ╋艺 镇╋  (http://wdystv.com/bbs/index.asp)
--  ┣◇网站建设&Web语言  (http://wdystv.com/bbs/list.asp?boardid=4)
----  asp中java日期自动相加代码  (http://wdystv.com/bbs/dispbbs.asp?boardid=4&id=32)

--  作者:乐魔舞
--  发布时间:2007/12/27 11:52:18
--  asp中java日期自动相加代码
face3|asp中java日期自动相加代码|乐魔舞||if (document.getElementById(\'\'niany\'\').options[document.getElementById (\'\'niany\'\').selectedIndex].value="月") { var goumaishi=document.getElementById("goumaishi").value;//var是 java里的定义,这里付值。 var baoxiu=document.getElementById("baoxiu").value; var end_day=goumaishi.substr(8, 2); var temp_goumaishi_year=goumaishi.substr(0, 4); // 获取子字符 串。2004-2-24 获取2004 var temp_goumaishi_month=goumaishi.substr(5, 2); // 获取子字符 串。2004-2-24 获取2 var month=(baoxiu)%12; var year=(baoxiu)/12; var end_year=year+temp_goumaishi_year; var end_date=end_year+month+end_day; document.getElementById("guobaoshi").value=end_date; var url1_length = goumaishi.length; var temp_goumaishi_year_right=goumaishi.substr(4, url1_length- 4);//用来最后合成 var result2_date=parseInt(temp_goumaishi_year)+5 var end2_date=result2_date+temp_goumaishi_year_right; document.getElementById("baofeishi").value=end2_date; } |2007-6-11 16:21:02