Link to home
Start Free TrialLog in
Avatar of kharandir
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 ?
Avatar of Tommy Hui
Tommy Hui

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.
Avatar of kharandir

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.
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) );

ASKER CERTIFIED SOLUTION
Avatar of creitzel
creitzel

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
COleDateTime::Format
CString Format(DWORD dwFlags = 0, LCID lcid = LANG_USER_DEFAULT);