Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I have a site, deployed on Azure.
I have a second code in Global.asax
C#
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-GB");
Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-GB");

and also
<globalization enableClientBasedCulture="true" uiCulture="en-GB" culture="en-GB" />

in my web.config

But, it doesn't work on azure. Looks like azure, no matter what, use us-US.
As a result, I am getting wrong symbols and date format.

How this issue can be fixed?

P.S Sorry for my bad English.
Posted

1 solution

Quote:
Azure runs all servers in UTC, which is appropriate.
You should never call DateTime.Now in a server application. That imposes the time zone of the server into the results. There is no good reason for that - you should be able to deploy your application anywhere.
Culture will only affect formatting, not time zones. And only the Culture setting affects the output of DateTime.ToString(). The UICulture doesn't matter (for this regard).
It's not picking up your values from web.config because it is case sensitive and you are using the incorrect casing.

Please read this for more : Azure localization
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900