T
Tobi
My apologies in advance...
I was doing what I thought should be fairly straightforward, creating
a Calendar like below:
protected boolean sendTime(){
boolean sendTime = false;
Calendar currentHoursCal = new GregorianCalendar();
int hour = currentHoursCal.HOUR_OF_DAY;
int hour2 = currentHoursCal.HOUR;
System.out.println("Calendar value: " + currentHoursCal);
System.out.println("currentHoursCal.HOUR_OF_DAY: " +
currentHoursCal.HOUR_OF_DAY);
System.out.println("currentHoursCal.HOUR: " +
currentHoursCal.HOUR);
if(hour > 23) {
sendTime = true;
}
return sendTime;
}
When I run this I see:
Calendar value:
java.util.GregorianCalendar[time=1213210518817,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="America/
New_York",offset=-18000000,dstSavings=3600000,useDaylight=true,transitions=235,lastRule=java.util.SimpleTimeZone[id=America/
New_York,offset=-18000000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDay=8,startDayOfWeek=1,startTime=7200000,startTimeMode=0,endMode=3,endMonth=10,endDay=1,endDayOfWeek=1,endTime=7200000,endTimeMode=0]],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2008,MONTH=5,WEEK_OF_YEAR=24,WEEK_OF_MONTH=2,DAY_OF_MONTH=11,DAY_OF_YEAR=163,DAY_OF_WEEK=4,DAY_OF_WEEK_IN_MONTH=2,AM_PM=1,HOUR=2,HOUR_OF_DAY=14,MINUTE=55,SECOND=18,MILLISECOND=817,ZONE_OFFSET=-18000000,DST_OFFSET=3600000]
currentHoursCal.HOUR_OF_DAY: 11
currentHoursCal.HOUR: 10
Which seems strange because the HOUR_OF_DAY in the Calendar object is
set 14, not 11. Likewise, the HOUR property is 2, not 10, as shown
above.
Am I not seeing something obvious?
Thanks
I was doing what I thought should be fairly straightforward, creating
a Calendar like below:
protected boolean sendTime(){
boolean sendTime = false;
Calendar currentHoursCal = new GregorianCalendar();
int hour = currentHoursCal.HOUR_OF_DAY;
int hour2 = currentHoursCal.HOUR;
System.out.println("Calendar value: " + currentHoursCal);
System.out.println("currentHoursCal.HOUR_OF_DAY: " +
currentHoursCal.HOUR_OF_DAY);
System.out.println("currentHoursCal.HOUR: " +
currentHoursCal.HOUR);
if(hour > 23) {
sendTime = true;
}
return sendTime;
}
When I run this I see:
Calendar value:
java.util.GregorianCalendar[time=1213210518817,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="America/
New_York",offset=-18000000,dstSavings=3600000,useDaylight=true,transitions=235,lastRule=java.util.SimpleTimeZone[id=America/
New_York,offset=-18000000,dstSavings=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDay=8,startDayOfWeek=1,startTime=7200000,startTimeMode=0,endMode=3,endMonth=10,endDay=1,endDayOfWeek=1,endTime=7200000,endTimeMode=0]],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2008,MONTH=5,WEEK_OF_YEAR=24,WEEK_OF_MONTH=2,DAY_OF_MONTH=11,DAY_OF_YEAR=163,DAY_OF_WEEK=4,DAY_OF_WEEK_IN_MONTH=2,AM_PM=1,HOUR=2,HOUR_OF_DAY=14,MINUTE=55,SECOND=18,MILLISECOND=817,ZONE_OFFSET=-18000000,DST_OFFSET=3600000]
currentHoursCal.HOUR_OF_DAY: 11
currentHoursCal.HOUR: 10
Which seems strange because the HOUR_OF_DAY in the Calendar object is
set 14, not 11. Likewise, the HOUR property is 2, not 10, as shown
above.
Am I not seeing something obvious?
Thanks