Re: CurrentUICulture problems en-GB
From: Pete Beech (peter_beech_at_hotmail.nojunk.com)
Date: 03/30/04
- Next message: Lowell: "RE: Error and double open dialog when downloading Excel file from ASP.NET."
- Previous message: me_at_privacy.net: "Re: Seeking opinions on asp2aspx (Netcoole software) - Converting asp to aspx"
- In reply to: Murray: "CurrentUICulture problems en-GB"
- Next in thread: Martin Dechev: "Re: CurrentUICulture problems en-GB"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 30 Mar 2004 17:02:28 +0200
There are 2 kinds of culture settings in .NET - CurrentCulture and
CurrentUICulture.
CurrentUICulture is used to get specific resources for a certain culture -
like strings for menu descriptions, etc, which you store in different
satellite resources.
CurrentCulture is for regional settings like dates, currency, number
formatting, etc. Thats the one you want here.
i.e.:
Thread.CurrentThread.CurrentCulture=new CultureInfo("en-GB");
Response.Write(CultureInfo.CurrentCulture.EnglishName);
Response.Write(CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern);
HTH,
Pete Beech
"Murray" <mlohoar@hotmail.com> wrote in message
news:6103d1ff.0403300636.56acf13b@posting.google.com...
> I have put the following code in two pages:
>
> Thread.CurrentThread.CurrentUICulture=new CultureInfo("en-GB");
> Response.Write(CultureInfo.CurrentUICulture.EnglishName);
>
Response.Write(CultureInfo.CurrentUICulture.DateTimeFormat.ShortDatePattern)
;
> Response.Write(DateTime.Now.ToShortDateString());
>
> in one page I get:
> English (United Kingdom)M/d/yyyy30/03/2004
>
> in the other I get:
> English (United Kingdom)M/d/yyyy3/30/2004
>
> Exactly the same code in the Page_Load on the same machine!
> Both have the same Culture settings in the web.config
> A part from the ShortDatePattern being wrong for the en-GB...
> What is going on here?
> Thanks
> Murray
- Next message: Lowell: "RE: Error and double open dialog when downloading Excel file from ASP.NET."
- Previous message: me_at_privacy.net: "Re: Seeking opinions on asp2aspx (Netcoole software) - Converting asp to aspx"
- In reply to: Murray: "CurrentUICulture problems en-GB"
- Next in thread: Martin Dechev: "Re: CurrentUICulture problems en-GB"
- Messages sorted by: [ date ] [ thread ]