当前位置: 技术问答>java相关
请问如何在jsp中取得当前日期的前十天?
来源: 互联网 发布时间:2015-10-08
本文导语: 比如:2002-10-22的前十天2002-10-12 谢谢。 | Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("CTT")); int differ = 10; Date newDate = calendar.getTime(); newDate.setTime(newDate.getTime()+differ*24*60*60*1000);
比如:2002-10-22的前十天2002-10-12
谢谢。
谢谢。
|
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("CTT"));
int differ = 10;
Date newDate = calendar.getTime();
newDate.setTime(newDate.getTime()+differ*24*60*60*1000);
int differ = 10;
Date newDate = calendar.getTime();
newDate.setTime(newDate.getTime()+differ*24*60*60*1000);