Where is the system locale/culture set for .Net

后端 未结 7 1521
时光取名叫无心
时光取名叫无心 2020-12-09 20:49

I have a problem with a c# assembly (.net 2.0 written using Visual studio 2005) that is installed on a UK server and should use UK regional settings.

What my code do

7条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-09 21:35

    The server is not configured correctly. Control Panel + Region and Language, Location tab. Changing this could be a bit tricky. The server may well have been mis-configured on purpose. Talk to the server administrator first before doing anything.

    Your fallback plan is to use the DateTime.TryParse() method overload that takes the IFormatProvider argument. Pass CultureInfo.GetCultureInfo("en-gb").DateTimeFormat.

提交回复
热议问题