• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1147
  • Last Modified:

Get regional settings using MFC

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.

Thanks
0
richardpeters
Asked:
richardpeters
1 Solution
 
ZoppoCommented:
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,

ZOPPO
0
 
richardpetersAuthor Commented:
Thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now