Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting Windows Regional settings 1

Status
Not open for further replies.

TheInsider

Programmer
Jul 17, 2000
796
CA
Hi,
I am working on a standard win32 project (no MFC). In the Windows 9X Control Panel/Regional Settings/Date tab you can choose your Short Date style, Long Date style, and the 2 Digit Year interpretation (in Win 98). I would like to know how I can programmatically obtain these formats so that I can input and output information in the same format as the user's operating system. i.e. if the user has a dd/mm/yy Short Date style format, I know to output today's date as 03/05/01 instead of 05/03/01.
Thanks, Rob Marriott
rob@career-connections.net
 
Hi

You can use the functions GetDateFormat and GetTimeFormat. These functions use the SYSTEMTIME structure.

HTH

Thierry
EMail: Thierry.Marneffe@swing.be

 
Thanks Thierry, I'll give it a try! I also found a tutorial on setting the short date format with SetLocaleInfo() but the tutorial doesn't include info on a GetLocaleInfo() function (if there is one). Rob Marriott
rob@career-connections.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top