public int getHourOfTheDay() {
if (mode == TWENTYFOUR_HOUR_MODE) {
return hourBox.getSelectedIndex();
}
int hour = hourBox.getSelectedIndex() + 1;
AM_PM ap = getAM_PM();
if (ap == AM_PM.AM && hour == 12) {
hour = 0;
} else if (ap == AM_PM.PM && hour != 12) {
hour += 12;
}