我與Calendar類演奏並得到了一些混亂的結果:Calendar類混亂
Calendar thisCal = Calendar.getInstance();
thisCal.clear();
thisCal.set(2012,12,8);
System.out.println("Year is: " + thisCal.get(Calendar.YEAR));
System.out.println("Month is: " + thisCal.get(Calendar.MONTH));
System.out.println("Day of Month is: " + thisCal.get(Calendar.DAY_OF_MONTH));
輸出:
新年是:2013
月是:0
日月份是:8
困惑我!
的Javadoc你會讀到和困惑不再是你會,尤達。 – mre 2012-01-10 17:13:42