I am using the Calendar class in java and am having trouble. I have this code
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("NZST"));
System.out.println("Calendar.HOUR_OF_DAY = " + calendar.get(Calendar.HOUR_OF_DAY));
System.out.println("Calendar.HOUR = " + calendar.get(Calendar.HOUR));
System.out.println("calendar.getTime() = " + calendar.getTime());
and I would expect it to output
Calendar.HOUR_OF_DAY = 17
Calendar.HOUR = 5
calendar.getTime() = Sat Aug 08 17:45:53 NZST 2020
but instead it outputs
Calendar.HOUR_OF_DAY = 5
Calendar.HOUR = 5
calendar.getTime() = Sat Aug 08 17:45:53 NZST 2020
So why does the HOUR_OF_DAY and HOUR return the same thing however, calendar.getTime() shows the correct HOUR_OF_DAY. They are both using NZST.