The website shows the wrong month for july
in Arabic, this is an Arabic website developed in the asp.net web form, and the culture is correctly set to " ar-AE ", and the date of the event shows the correct month in local but in production it shows the month that belongsEgyptian culture
The date in the database is saved as smalldatetime
in this format2017-07-25 00:00:00
The wrong month for July
The correct month on the local host: 25 ููููู 2017
Wrong production month: 25 ููููู 2017
<asp:Label ID="lblDate" runat="server" Text='<%# FormatDate(Eval("PublishDate")) %>'>
</asp:Label>
protected string FormatDate(object dt) {
string date = String.Format("{0:MMMM dd, yyyy}", dt);
date = String.Format("{0:dd MMMM yyyy}", dt);
return date;
}
The culture is correctly established in the UAE
protected override void InitializeCulture() {
String lang = "ar-AE";
CultureInfo ci = System.Threading.Thread.CurrentThread.CurrentUICulture;
Thread.CurrentThread.CurrentCulture = new CultureInfo(lang);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang);
base.InitializeCulture();
}
What could be the reason, maybe it's the production server itself?
, , .
. , IIS. , . , , , , , - . Windows 7, .
. , JULY ููููู
. . .
https://dotnetfiddle.net/ZAOJ7H