RE: Set culture for a DLL (class library) referenced from web applicat

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: MikeL (MikeL_at_discussions.microsoft.com)
Date: 11/21/04


Date: Sun, 21 Nov 2004 14:53:01 -0800

Ya Ya,

See this article on settig culture.

http://www.dotnetjunkies.com/Tutorial/17E26271-E212-4248-965F-4B33D2EDD38B.dcik

I don't believe you are setting the culture on the thread and the
application assumes the culture of the server.

HTH MikeL.

"Ya Ya" wrote:

> I am developing a DLL (class library) for a web application of mine.
>
> In the web.config of the web application I have set: culture="en-GB"
> uiCulture="en" in order that the date format will be dd/mm/yyyy.
>
> I also changed the regional settings to that date format.
>
> When I am using the Now() function in the DLL I get the date format in
> mm/dd/yyyy instead. Why the date format in the DLL is different? Shouldn't
> it take the culture settings from the web application he is referenced from?
>
> How can I control the date format of the DLL (class library)?
>
>
> Thanks for your time
>
> ra294@hotmail.com
>
>
>



Relevant Pages

  • Re: Inserting regional settings specific data into sql server
    ... Italianyou will observe that the settings used are 10/02/2006 ... it a better idea to Format it using the string format functions or a very ... into the sql database.Sorry to bug the shorts off you but u now have context ... By using the parameters, while the program is in the right culture setting, ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Data Format on SharePoint pages - how to set
    ... I'm not interested in changing how dates are displayed in custom lists, but rather the default date format for the all pages that are automatically created by SharePoint - e.g. the Shared Documents page. ... The user might choose to override some of the values associated with the current culture of Windows through Regional and Language Options (or Regional Options or Regional Settings) in Control Panel. ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Data Format on SharePoint pages - how to set
    ... \par global change for the entire SharePoint installation. ... \par date format for the all pages that are automatically created by SharePoint - ... \par says that the .NET Culture can be set for a web site in the web.config file. ... \par Regional Options or Regional Settings) in Control Panel. ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: DateTime.Now.ToString("t") not printing what I expect
    ... the settings can be found at the user's registry key ... Based on what account your ASP.NET web application is running at, ... account's settings will be used as default date time format ... I'm not sure by means of "I want it to follow the current culture ...
    (microsoft.public.dotnet.framework)
  • Re: DateTime.Now.ToString("t") not printing what I expect
    ... the settings can be found at the user's registry key ... Based on what account your ASP.NET web application is running at, ... I'm not sure by means of "I want it to follow the current culture ... you can first find its SID using PsGetSid and look at ...
    (microsoft.public.dotnet.framework)