Calendar cd = Calendar.getInstance();
cd.setTime(new Date());
cd.add(Calendar.YEAR, -20);
Date newDate = cd.getTime();
cd.setTime(new Date());
cd.add(Calendar.YEAR, -20);
Date newDate = cd.getTime();
解决方案 »
- jsp+DAO+Servlet
- 几道面试题
- eWebEditor在Liux 下显示乱码,为什么
- 如何在JAVA中调用SQL Server中的存储过程?
- jsp+tomcat 6 url 问题
- 求SSH框架完成的小实例,类似我们学每种语言都会第一个写下helloword的小屁程序。
- josn转换为数组
- 刚才的问题已解决,但是还有问题!连接oracle数据库!!!
- 为什么提交给mysql的中文字符变成了乱码
- ODBC数据源访问远程数据库,用户名和密码都是 dbget ,然后连接后用程序在数据库中新建一些表,模式名也是用 dbget,为什么在查询的时候
- 用JSP编写FTP服务器的帐号注册页面
- 要怎么做才能让页面显示 403 错误?(没有足够权限访问时)
如果是String型,date = Integer.parse(date.substring(0,4))-20+date.substring(date.substring(4))
var d,s;
d = new Date();
s+= (d.getFullYear()-30)+"-";
s+= (d.getMonth()+1)+"-";
s+= d.getDate();
return(s);
)fm.all('Birthday').value=getBirthday(); 就会出错,错在哪里啊?Birthday是控件名
把
Calendar cd = Calendar.getInstance();
cd.setTime(new Date());
cd.add(Calendar.YEAR, -20);
Date newDate = cd.getTime();
写在我的函数中,fm.all('Birthday').value=newDate;就会出错,为什么啊?
<body>
<input type="text" name="qq" value="">
<script>
function getBirthday(){
var d,s;
d = new Date();
s= (d.getYear()-30)+"-";
s+= (d.getMonth()+1)+"-";
s+= d.getDate();
return(s);
}
document.all("qq").value=getBirthday();
</script>
</body>
</html>这个是我的测试代码,这样没有问题。
s+= (d.getFullYear()-30)+"-";改为:
s= (d.getFullYear()-30)+"-";输入错误!