Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

International Date format

Posted on 1998-01-23
6
Medium Priority
?
603 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
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 

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 330 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

688 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