Sometimes its creating problem for the parsing the date in formate yyyy-mm-dd and giving a ParseException even the date is passing in the yyyy-mm-dd format.
I have created the static instance of the SimpleDateFormat in my class and i am going to parse the date using the static method.
I am running this utility on the Web logic environment.
public static final
String WS_DATE_PATTERN = "yyyy-MM-dd";
static SimpleDateFormat sdfWS = new SimpleDateFormat(WS_DATE_PATTERN);
.
.
.
public static Calendar convertWSDate(String date) throws ParseException{
Calendar calendar = Calendar.getInstance();
calendar.setTime(DateUtils.sdfWS.parse(date));
return calendar;
}
Please Guide me whats the issue as soon as possible.