I’m creating an instance of java.util.Calendar class:
Calendar rightNow = Calendar.getInstance();
getInstance() gets a Calendar using the default time zone and locale… Its 20:22 1.11.2012 in Poland right now, but when I print rightNow field out, the result is wrong:
System.out.print(rightNow.get(Calendar.MONTH));
result: 10.
System.out.print(rightNow.get(Calendar.DAY_OF_MONTH));
result: 1.
System.out.print(rightNow.get(Calendar.DATE));
result: 1.
I supose that in December the YEAR field will also be wrong. Can somebody explain that to me?
Month starts from 0 when you use calendar not from 1
As per javadoc