我需要找到用户给出的两个日期的星期三。示例:输入是:从日期:07-Feb-2013 到日期:13-feb-2013 从日期和到日期之间的间隔始终为 7 天。预期产出:2013 年 2 月 12 日
public String getAutoDayExpiryDateAndToDate(String instrmentId,String deliveryAutoFromDate)
throws SystemException, FunctionalException,ParseException
{
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date(deliveryAutoFromDate));
Date fromDate=calendar.getTime();
SimpleDateFormat sf1 = new SimpleDateFormat("dd-MMM-yyyy");
String formatedDate = sf1.format(fromDate);
calendar.add(Calendar.WEEK_OF_MONTH, 1);
calendar.add(Calendar.DAY_OF_WEEK,-1);
Date time = calendar.getTime();
SimpleDateFormat sf = new SimpleDateFormat("dd-MMM-yyyy");
String formatedDate1 = sf.format(time);
}
在这些之后,我需要找到在 formatedDate 和 formatedDate1 之间存在的周三。我该怎么做?