From 29cdd30dbc19618b91d8e438a8b208141078f79a Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Mon, 31 Mar 2008 07:37:19 +0000 Subject: [PATCH] Fix for FS#8820 by Christopher Williams - Misformatted time in Rockbox Info git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16899 a1c6a512-1295-4272-9138-f99709370657 --- apps/menus/main_menu.c | 10 ++++++---- docs/CREDITS | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c index 7c2e87c410..0278af3668 100644 --- a/apps/menus/main_menu.c +++ b/apps/menus/main_menu.c @@ -183,10 +183,12 @@ static char* info_getname(int selected_item, void *data, char *buffer) case INFO_TIME: tm = get_time(); snprintf(buffer, MAX_PATH, "%02d:%02d:%02d %s", - global_settings.timeformat == 0 ? tm->tm_hour : tm->tm_hour-12, - tm->tm_min, - tm->tm_sec, - global_settings.timeformat == 0 ? "" : tm->tm_hour>11 ? "P" : "A"); + global_settings.timeformat == 0 ? tm->tm_hour : + ((tm->tm_hour + 11) % 12) + 1, + tm->tm_min, + tm->tm_sec, + global_settings.timeformat == 0 ? "" : + tm->tm_hour>11 ? "P" : "A"); break; case INFO_DATE: tm = get_time(); diff --git a/docs/CREDITS b/docs/CREDITS index b371e5cf81..5bd1810a8e 100644 --- a/docs/CREDITS +++ b/docs/CREDITS @@ -383,6 +383,7 @@ Marcel Barbulescu Phil Light Rob Purchase Andreas Müller +Christopher Williams The libmad team