.Net Globalization not working as it supposed to do on specific server
I've got some sort of issue that never faced before. I've moved a website which has two languages (English/Arabic) from one server to another, everything works fine except the Date Globalization. I am using ar-AE, and when I convert Date using this format, it just returns English version. But if I use ar-SA, it will return Arabic format but in Hijri Calendar, which is what I don't want. If you don't know, ar-AE will not convert date to Hijri date and i开发者_如何学Gonstead just changes the notation to Arabic. I am using .Net framework 3.5 SP1.
Example:
Response.Write(DateTime.UtcNow.ToString("dddd MMMM dd, yyyy",System.Globalization.CultureInfo.CreateSpecificCulture("ar-AE")));
Anybody has idea how to overcome this issue?
public void Page_Load()
{
Thread.CurrentThread.CurrentCulture = new CultureInfo("ar-AE");
}
if it works then you should check your server settings . if you can't modify them you should put this piece of code in your global.asax in the Application_BeginRequest
further instructions here
of course i assumed here it was an asp.net issue but if it's a winform/wpf issue it will work the same way you'll just have to find the proper events to add this piece of code.
Note that adding this to your page or your global.asax will affect either the whole page or the whole site.
精彩评论