String s = "20121201"; SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); Date date = sdf.parse(s); Calendar c = Calendar.getInstance(); c.setTime(date);
------解决方案--------------------
Field number for get and set indicating the month. This is a calendar-specific value. The first month of the year is JANUARY which is 0; the last depends on the number of months in a year.