java.text.ParseException
Stringstr="1988-09-09";SimpleDateFormatsdf=newSimpleDateFormat();java.util.Datedate=s...
String str = "1988-09-09";
SimpleDateFormat sdf = new SimpleDateFormat();
java.util.Date date = sdf.parse(str);
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
System.out.println(calendar.get(Calendar.MONTH));
就是指定了格式,还是那个异常 展开
SimpleDateFormat sdf = new SimpleDateFormat();
java.util.Date date = sdf.parse(str);
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
System.out.println(calendar.get(Calendar.MONTH));
就是指定了格式,还是那个异常 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询