Website show wrong month for july
in arabic, this is Arabic website developed in asp.net webform and culture is set properly to 'ar-AE' and event date shows correct month on local machine but on productions it show month which belongs to Egyptian culture
Date in database is stored as smalldatetime
in this format 2017-07-25 00:00:00
Wrong month for July
Correct month on local-host :25 يوليو 2017
Wrong month on production : 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);
// Response.Write(date + "<br/>");
return date;
}
Culture is set to UAE correctly
protected override void InitializeCulture() {
String lang = "ar-AE";
CultureInfo ci = System.Threading.Thread.CurrentThread.CurrentUICulture;
// Call function to detect Language and assign to session variable
Thread.CurrentThread.CurrentCulture = new CultureInfo(lang);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang);
base.InitializeCulture();
}
What could be the reason, could it be production server itself?
We check almost all possibilities and tried everything, it just gets wrong month for July rest all is ok.
I also cross check production server Language setting, IIS settings, it all seems to be okay, only thing i can point is that server has all latest updates, may be we are missing something. we tested same on different windows 7 machine it just works fine.
Update: I have tried solution suggest also but it keeps showing wrong month for JULY يوليه
. This is wrong. We tested it also it show the correct culture on the server.
Fiddle example also show wrong month https://dotnetfiddle.net/ZAOJ7H