Home All Groups Group Topic Archive Search About

How to get DateTime format settings from Control Panel

Author
23 Jun 2006 7:45 AM
Egil Winther
Hi everyone,

I'm having difficulties retrieving datetime formats that has been customized
in the control pane.

I can get the cultureinfo, but I get same settings regardless of what i do
in the control panel.

Any ideas?

Brgds
Egil Winther
¨ShipNet AS

Author
23 Jun 2006 2:44 PM
Markus Kling
The CurrentUICulture defaults to the current user UI language settings but
does not reflect the individual settings. You must get and set them manually
from HKEY_CURRENT_USER\Control Panel\International and change the
CultureInfo object accordingly.

Markus


Show quote
"Egil Winther" <egil.wint***@shipnet.no> schrieb im Newsbeitrag
news:e2AQjiplGHA.3576@TK2MSFTNGP04.phx.gbl...
> Hi everyone,
>
> I'm having difficulties retrieving datetime formats that has been
> customized in the control pane.
>
> I can get the cultureinfo, but I get same settings regardless of what i do
> in the control panel.
>
> Any ideas?
>
> Brgds
> Egil Winther
> ¨ShipNet AS
>
>
Author
24 Jun 2006 8:50 AM
Mihai N.
"Markus Kling" <markus.kling@nospam.nospam> wrote in
news:#zPpBOtlGHA.4512@TK2MSFTNGP04.phx.gbl:

> The CurrentUICulture defaults to the current user UI language settings but
> does not reflect the individual settings. You must get and set them
> manually
> from HKEY_CURRENT_USER\Control Panel\International and change the
> CultureInfo object accordingly.
For formatting info you should use CurrentCulture, never CurrentUICulture.
CurrentUICulture is used for UI language settings (as you mentioned).

--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email
Author
26 Jun 2006 8:26 AM
Egil Winther
Thanks guys,

I have tried using the CurrentCulture, but it does not seem to change
whatever I do in the control panel.

I will try to use the registry setting and see what happens.

Brgds
Egil Winther
ShipNet AS


Show quote
"Mihai N." <nmihai_year_2***@yahoo.com> wrote in message
news:Xns97EC12B31F5A2MihaiN@207.46.248.16...
> "Markus Kling" <markus.kling@nospam.nospam> wrote in
> news:#zPpBOtlGHA.4512@TK2MSFTNGP04.phx.gbl:
>
>> The CurrentUICulture defaults to the current user UI language settings
>> but
>> does not reflect the individual settings. You must get and set them
>> manually
>> from HKEY_CURRENT_USER\Control Panel\International and change the
>> CultureInfo object accordingly.
> For formatting info you should use CurrentCulture, never CurrentUICulture.
> CurrentUICulture is used for UI language settings (as you mentioned).
>
> --
> Mihai Nita [Microsoft MVP, Windows - SDK]
> http://www.mihai-nita.net
> ------------------------------------------
> Replace _year_ with _ to get the real email

AddThis Social Bookmark Button