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 Andrews 2003-06-23 16:01:11 +00:00
parent 4d8cde2b41
commit 17527010e2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=116739

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);