我正在设置一个日历对象
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy hh:mm");
String datetime_str = "08-03-2013 12:00";
Calendar cal = Calendar.getInstance();
cal.setTime(formatter.parse(datetime_str));
我为我的 cal 对象得到了这个:
java.util.GregorianCalendar[time=1362697200000,areFieldsSet=true,lenient=true,zone=Europe/Amsterdam,firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=2013,MONTH=2,WEEK_OF_YEAR=10,WEEK_OF_MONTH=2,DAY_OF_MONTH=8,DAY_OF_YEAR=67,DAY_OF_WEEK=6,DAY_OF_WEEK_IN_MONTH=2,AM_PM=0,HOUR=0,HOUR_OF_DAY=0,MINUTE=0,SECOND=0,MILLISECOND=0,ZONE_OFFSET=3600000,DST_OFFSET=0]
我没想到的部分
HOUR_OF_DAY=0,MINUTE=0,SECOND=0
为什么 12(中午)改为“00”(午夜)?