解决方案 »
- 有工作经验或水平不错的进来
- tomcat如何改变应用程序的网址
- jpa小问题
- struts1.2 下配置tiles
- 紧急帮忙啊,The server encountered an unexpected condition which prevented it from fulfilling the request.
- Struts中单选框怎么做呀,请教高手,不胜感激?
- 怎么每隔一定时间自动执行一个方法
- hibernate 删除主键记录,让外键表外键字段为空
- 简单的servlet问题
- (100分)请教一个学习过程
- 100分问个性能瓶颈的问题,求大神帮助
- 如何通过JAVA将文件夹下的文件重新按照规则命名
Date now = new Date();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar = new GregorianCalendar();
calendar.setTime(now);
calendar.add(calendar.DATE, 25);// +25天
System.out.println("今天的日期+25天:" + format.format(calendar.getTime()));
}
System.out.println(24 * 24 * 60 * 60 * 1000);
System.out.println(Integer.MAX_VALUE);
System.out.println(25 * 24 * 60 * 60 * 1000);
2073600000
2147483647
-2134967296
想使用这种方式的话,可以
25L * 24 * 60 * 60 * 1000
99L * 24 * 60 * 60 * 1000
先转换为long 类型,然后就不会出错了