I am not able to set a particular date to 12 noon. I have read a bunch of posts, but I do not see what I am doing wrong. When I try to set 03/01/2008 12:30 PM, the Calendar keeps coming back with 00 for the hour. I have tried setting HOUR_OF_DAY to 12, and I have tried the other approach setting HOUR = 0 and AM_PM to PM, but I get the same results. I also tried setting setLenient(false). How do you set a Calendar to 12 noon in Java 5?
Thanks.
// Set year, month, day, hour and minute attributes of calendar instance
calendar.set(Calendar.YEAR, year.intValue());
calendar.set(Calendar.MONTH, TimestampUtility.translateMonthForCalendar(month.intValue()));
calendar.set(Calendar.DAY_OF_MONTH, day.intValue());
calendar.set(Calendar.MINUTE, minute.intValue());
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
calendar.set(Calendar.HOUR_OF_DAY, hour.intValue());