我需要将当前日期 +7 天添加到我的 sql 数据库中并将其取回我该怎么做?
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, 7); // add 7 days
int date = cal.get(Calendar.DATE);
int month = cal.get(Calendar.MONTH);
int year = cal.get(Calendar.YEAR);
String newdate = Integer.toString(date);
String concat = newdate.concat("-" + Integer.toString(cal.get(Calendar.MONTH)) + "-" + Integer.toString(cal.get(Calendar.YEAR)));
我找到了这段代码
java.util.Date newDate = new Date(result.getDate("VALUEDATE").getTime());