International Date format

Posted on 1998-01-23
Last Modified: 2013-11-20
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 ?
Question by:kharandir
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 15

Expert Comment

by:Tommy Hui
ID: 1314601
You need to look up the locale information. Basically, you should take a look at GetTimeFormat() and GetDateFormat().

Expert Comment

ID: 1314602
Are you using MFC, then there is better solution.

Author Comment

ID: 1314603
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.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 1314604
GetDateFormat() *is* the correct answer.  You might want to use
GetLocaleInfo() first, but it is not required.

         TCHAR datefmt[ 32 ];
         GetLocaleInfo( LOCALE_USER_DEFAULT,
                                  datefmt, sizeof(datefmt) );


Accepted Solution

creitzel earned 110 total points
ID: 1314605
You need COleDateTime::ParseDateTime().  If you aren't using MFC, then you can use VarDateFromStr() which is described in oleauto.h.  
LVL 23

Expert Comment

ID: 1314606
CString Format(DWORD dwFlags = 0, LCID lcid = LANG_USER_DEFAULT);

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question