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:
parent
bc7d9d78f7
commit
003ad51e2a
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user