Handle 12-hour clocks properly: when the time is 00:00-00:59, adjust the

hour to 12 so the time reads "12:00-12:59 AM".
This commit is contained in:
will 2003-06-23 16:01:11 +00:00
parent bc7d9d78f7
commit 003ad51e2a

View File

@ -149,8 +149,12 @@ int t12;
if (tm->tm_hour > 12) {
tm->tm_hour -= 12;
mvaddstr(YBASE + 5, XBASE + 52, "PM");
} else
} else {
if (tm->tm_hour == 0)
tm->tm_hour = 12;
mvaddstr(YBASE + 5, XBASE + 52, "AM");
}
}
set(tm->tm_hour%10, 20);