Solved

International Date format

Posted on 1998-01-23
6
589 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
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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
iSeries DB2 Query 2 95
sumHeights2  challenge 7 108
Annoying "thing" blocks my view 4 103
mapAB Challlenge 35 147
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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…
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.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

825 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