473,387 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Get the CultureInfo object according to the OS settings...

Hi,

I thought that using CultureInfo.CurrentUICulture would give me the current
date format as set in the OS - but it did not work that way :-( When
re-reading the docs I can see why: "Gets the CultureInfo that represents the
current culture used by the Resource Manager to look up culture-specific
resources at run time.", i.e. it gave me the date format according to the
Resource Manager. Fair enough. Problem is I do not exactly know what that
mean.

How do I know which Resource Manager is used? Even better, how do I get the
CultureInfo object for the current localized settings as specified in the
OS?

Thanks!

TS
Nov 16 '05 #1
1 3955
Hello

The CurrentCulture property will return the CultureInfo used for formatting
dates and numbers and used for string comparisons.
The CurrentUICulture property will return the CultureInfo used by the
resource manager to get localized strings. You must specify country in
CurrentCulture for example (en-gb, en-us, de-de, de-at, etc) while
CurrentUICulture can be more general (like en, de etc).

Best regards,
Sherif

"tommys" <so*****@microsoft.com> wrote in message
news:ui**************@TK2MSFTNGP09.phx.gbl...
Hi,

I thought that using CultureInfo.CurrentUICulture would give me the current date format as set in the OS - but it did not work that way :-( When
re-reading the docs I can see why: "Gets the CultureInfo that represents the current culture used by the Resource Manager to look up culture-specific
resources at run time.", i.e. it gave me the date format according to the
Resource Manager. Fair enough. Problem is I do not exactly know what that
mean.

How do I know which Resource Manager is used? Even better, how do I get the CultureInfo object for the current localized settings as specified in the
OS?

Thanks!

TS

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: choyk1 | last post by:
Hi all, I cannot serialize CultureInfo property as below. It invokes InvalidOperationException. public class One { private CultureInfo culture;
1
by: rerdavies | last post by:
OS: WIndows Server 2003. Currently logged in user is running with German(German) regional settings. Code fragment: System.Globalization.CultureInfo culture = new...
12
by: magister | last post by:
Hello, I know I can set the Culture to what I want, but shouldn't the current culture be taken from the regional settings on the web server's control panel!!! Mine is set to "united kingdom"...
3
by: Cammie Watson | last post by:
We have 2 web servers that seem identical, the same version of 2 applications are installed (Web / Windows), they utilize the same SQL server and have the same regional settings. However, Server...
2
by: Urs Vogel | last post by:
Hi I've been taken by surprise when I realized that MyDouble.ToString() actually formats the string based on the local settings of the machine it was installed on (rather than using...
8
by: G.Ashok | last post by:
Hi, I have created CultureInfo object and specified required digit grouping in it. The one of the overloaded ToString methods of Decimal type has parameters to format the value with required...
3
by: schaf | last post by:
Hi NG! My situation: I call a function on a related system and this function call results in a fired event, handled in my app. I recognized that the handle method runs in his own thread and this...
8
by: Phil Jollans | last post by:
Hi, I am having difficulty overriding the ToString() method of CultureInfo using Visual Studio 2005. Exactly the same code works fine with Visual Studio .NET 2003. What I am doing is adding...
8
by: =?Utf-8?B?T2xpdmllciBHSUw=?= | last post by:
Hello, I try to convert a volume stored as a string value in an XML file into a Decimal object. The volume is stored with comma as decimal separator ("210,12") according to french habits. To be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.