[Webinar] Learn how to a build a cloud-first strategyRegister Now


Get regional settings using MFC

Posted on 2008-11-06
Medium Priority
Last Modified: 2013-12-14
I am working on an international application and need to be able to check the user's regional options for

Time separator
AM symbol
PM symbol

Can someone show me how to do this with MFC?  I am using Visual C++ Version 6.

Question by:richardpeters
LVL 31

Accepted Solution

Zoppo earned 2000 total points
ID: 22895732
Hi richardpeters,

you can use the 'GetLocaleInfo' function.

As first arg you pass 'LOCALE_USER_DEFAULT' to get info about the user's settings.

As second arg pass one of these:

- LOCALE_ITIME: The result string is '0' if AM/PM is active, if 24-hour time is active it's '1'
- LOCALE_S1159: The symbol for 'AM'
- LOCALE_S2359: The symbol for 'PM'
- LOCALE_STIME: The time seperator
- LOCALE_STIMEFORMAT: The time format string

Hope that helps,


Author Closing Comment

ID: 31513886
Thank you.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this post we will learn different types of Android Layout and some basics of an Android App.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
Suggested Courses
Course of the Month20 days, 12 hours left to enroll

864 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