Get the current system time format in Windows using C++/MFC



Code to get the currently configured system time format in Windows using C++/MFC.

 
CString	GetLocaleTimeFormat()
{
       CString timeFormat;
       GetLocaleInfo(LOCALE_USER_DEFAULT, 
		LOCALE_STIMEFORMAT, timeFormat.GetBufferSetLength(255), 255);
	timeFormat.ReleaseBuffer();
 
	return timeFormat;
}


Leave a Reply

Your email address will not be published. Required fields are marked *