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

  • Thread starter Thread starter tommys
  • Start date Start date
T

tommys

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
 
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
 
Back
Top