Solved

International Date format

Posted on 1998-01-23
6
598 Views
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 ?
0
Comment
Question by:kharandir
[X]
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
6 Comments
 
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().
0
 
LVL 2

Expert Comment

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

Author Comment

by:kharandir
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.
0
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

by:creitzel
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,
                                 LOCALE_SSHORTDATE,
                                  datefmt, sizeof(datefmt) );

0
 

Accepted Solution

by:
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.  
0
 
LVL 23

Expert Comment

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

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