Date plandate = planDate.toDate();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
Calendar cal = Calendar.getInstance();
cal.setTime(plandate);
// 取得三个月后时间
cal.add(Calendar.MONTH, 3);
planDate = UFDate.getDate(df.format(cal.getTime()));
Java日期操作
本文介绍如何使用Java进行日期的加减操作,包括将当前日期加上三个月的具体实现方式。
Date plandate = planDate.toDate();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
Calendar cal = Calendar.getInstance();
cal.setTime(plandate);
// 取得三个月后时间
cal.add(Calendar.MONTH, 3);
planDate = UFDate.getDate(df.format(cal.getTime()));
2912
3493
330
8343

被折叠的 条评论
为什么被折叠?