我们的一台应用程序服务器上的日期时间存在问题。
问题是日期时间选择区域设置为 en-US,而我们希望使用 en-GB。
我尝试将服务器区域和语言选项更改为英国,但仍然存在相同的问题。
我可以强制 DateTime 使用 en-GB,但这需要在不同位置更改代码。
我尝试在 web.config 文件中添加全球化设置,但日期时间仍选择为美国。
由于代码在所有其他服务器上都可以正常工作,因此有什么方法可以在该服务器上解决此问题吗?
We are haveing issue with DateTime on one of our application servers.
The issue is the datetime is picking the locale settings as en-US and we want to use en-GB.
I tried to Change the server Regional and Language options to UK still having the same issue.
I could force DateTime to use en-GB but this will require code changes at various location.
I tried to add globalization settings in web.config file still date time is picked as US.
Is there a way I can fix this issue on that server since the code works fine on all other servers?
发布评论
评论(1)
设置
。设置culture 和uiculture 参数。如果这不起作用,您可以通过 global.asax 设置每个线程的区域设置。It should be sufficient to set the
<globalization>
section in web.config. Set both the culture and uiculture parameter. If that won't work you can set the locale per thread via global.asax.