kharandir
asked on
International Date format
I need to display the date/time in the local user format. What is the object in the Date&Time in the control panel ?
What are the class member ? Where can I found information about this ?
What are the class member ? Where can I found information about this ?
You need to look up the locale information. Basically, you should take a look at GetTimeFormat() and GetDateFormat().
Are you using MFC, then there is better solution.
ASKER
I'm using the MFC (Visual C++ 5.0 under NT/95).
I need to be able to set and get the date/time and to parse the string I will receive with the get.
I need to be able to set and get the date/time and to parse the string I will receive with the get.
GetDateFormat() *is* the correct answer. You might want to use
GetLocaleInfo() first, but it is not required.
TCHAR datefmt[ 32 ];
GetLocaleInfo( LOCALE_USER_DEFAULT,
LOCALE_SSHORTDATE,
datefmt, sizeof(datefmt) );
GetLocaleInfo() first, but it is not required.
TCHAR datefmt[ 32 ];
GetLocaleInfo( LOCALE_USER_DEFAULT,
LOCALE_SSHORTDATE,
datefmt, sizeof(datefmt) );
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
COleDateTime::Format
CString Format(DWORD dwFlags = 0, LCID lcid = LANG_USER_DEFAULT);
CString Format(DWORD dwFlags = 0, LCID lcid = LANG_USER_DEFAULT);