Time format
-
How to get the system Clock Style, I mean weather it 12 hr clock style or 24 hr clock style. Thanks.
The system clock does not have a style it is merely a counter used to calculate the current time since some predefined date. However any clock displays used in Windows will access the regional settings to determine how such times should be displayed. I am not sure of the simple way to access the details but you could take a look at the
HKEY_CURRENT_USER\Control Panel\International
registry key.It's time for a new signature.
-
How to get the system Clock Style, I mean weather it 12 hr clock style or 24 hr clock style. Thanks.
Try it :) :
bool GetTimeFormattedBySystem(const SYSTEMTIME& sSomeTime,
CString& cszReceiver)
{
static const int iTimeStrLen(40);
static TCHAR szResult[iTimeStrLen];cszReceiver.Empty();
if (GetTimeFormat(LOCALE_USER_DEFAULT,
0,
&sSomeTime,
NULL,
szResult,
iTimeStrLen)) {
cszReceiver = szResult;
}return (0 < cszReceiver.GetLength());
}virtual void BeHappy() = 0;
-
How to get the system Clock Style, I mean weather it 12 hr clock style or 24 hr clock style. Thanks.
Have you tried
GetLocaleInfo(LOCALE_ITIME)
?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius