Skip to content

Commit

Permalink
Header: fix 12-hours clock display (koreader#465)
Browse files Browse the repository at this point in the history
Show 12:15 AM instead of 00:15.
  • Loading branch information
zwim authored Mar 17, 2022
1 parent ee3191b commit 1dc1728
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crengine/src/lvdocview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1354,10 +1354,10 @@ lString32 LVDocView::getTimeString() {
tm * bt = localtime(&t);
char str[12];
if ( m_props->getBoolDef(PROP_SHOW_TIME_12HOURS, false) ) {
sprintf(str, "%d:%02d", bt->tm_hour > 12 ? bt->tm_hour % 12 : bt->tm_hour, bt->tm_min);
strftime(str, sizeof(str), "%I:%M %p", bt);
}
else {
sprintf(str, "%02d:%02d", bt->tm_hour, bt->tm_min);
strftime(str, sizeof(str), "%H:%M", bt);
}
return Utf8ToUnicode(lString8(str));
}
Expand Down

0 comments on commit 1dc1728

Please sign in to comment.