2005-02-06, 10:01
hi,
i use the show 12 hour clock display.
between 12:00 pm and 12:59 pm it displays am and 12:00 am to 12:59 am it displays 00:00 am to 00:59 am.
here is a code sample that fixes this. i didn't consider this a patch, so i hope you don't mind me posting it here.
edit: i also took out the leading zero for hours that are single digit.
i use the show 12 hour clock display.
between 12:00 pm and 12:59 pm it displays am and 12:00 am to 12:59 am it displays 00:00 am to 00:59 am.
here is a code sample that fixes this. i didn't consider this a patch, so i hope you don't mind me posting it here.
edit: i also took out the leading zero for hours that are single digit.
Quote:void cguiwindowhome::gettime(wchar* sztime, lpsystemtime ptime)
{
if (!sztime) return;
if (!ptime) return;
int ihour = ptime->whour;
if (g_guisettings.getbool("lookandfeel.clock12hour"))
{
if (ihour>11)
{
ihour-=(12*(ihour>12));
swprintf(sztime,l"%2d:%02d pm", ihour, ptime->wminute);
}
else
{
ihour+=(12*(ihour<1));
swprintf(sztime,l"%2d:%02d am", ihour, ptime->wminute);
}
}
else
swprintf(sztime,l"%02d:%02d", ihour, ptime->wminute);
}