boolean isAvailableDate(EventMainBean eventMain) throws Exception{
boolean result = false;
String pattern = "yyyyMMdd";
Calendar calendar = Calendar.getInstance();
SimpleDateFormat formatter = new SimpleDateFormat(pattern, new Locale("ko","KOREA"));
Date stDate = formatter.parse(eventMain.getDistributionStDate());
Date edDate = formatter.parse(eventMain.getDistributionEdDate());
Calendar stDateInCalendar = (Calendar)calendar.clone();
stDateInCalendar.setTime(stDate);
Calendar edDateInCalendar = (Calendar)calendar.clone();
edDateInCalendar.setTime(edDate);
edDateInCalendar.add(Calendar.DATE, 1);
if ( calendar.after(stDateInCalendar) && calendar.before(edDateInCalendar) )
result = true ;
System.out.println(calendar.after(stDateInCalendar));
System.out.println(calendar.before(edDateInCalendar));
System.out.println(result);
return result;
}
2008년 2월 29일 금요일
JAVA : USE CALENDAR
작성자: StillRabbit 시간: 오전 2:18
피드 구독하기:
댓글 (Atom)
댓글 없음:
댓글 쓰기