Calendar is an added class of JDK 1.1 recently used the next calendar to find a few very maddening questions Source:Public final static int SUNDAY = 1;Public final static int MONDAY = 2;Public final static int Tuesday = 3;Public final static int Wednesday = 4;Public final static int Thursday = 5;Public final static int FRIDAY = 6;Public final static int SATURDAY = 7;Did you find out? Yes, it's true, Monday. (MONDAY) The corresponding value is 2, not one, and the other values are backwards 1 digits. The same, source code:Public final static int January = 0; Public final static int February = 1;Public final static int March = 2;Public final static int APRIL = 3;Public final static int may = 4;Public final static int JUNE = 5;Public final static int july = 6;Public final static int August = 7;Public final static int September = 8;Public final static int october = 9;Public final static int November = ten;Public final static int december = one;Yes, the month also has the same problem. You can handle the wrong time.
"JAVA" Jdk-calendar encountered a pit