In our development machine which is running on Windows 10, "fa-IR" culture works fine and all dates display using Persian calendar. But when we deploy our app on Windows Server 2012 r2, datetime is still in Gregorian.
Persian culture in Windows Server 2012 r2
921 Views Asked by moo At
3
There are 3 best solutions below
0

for clarification of the problem we have with fa-IR in Windows Server2012, here is an example that works fine in Windows 10 but do not work in Windows 2012:
DateTime startDate;
CultureInfo c = CultureInfo.CreateSpecificCulture("fa-IR");
DateTime.TryParse("1990/02/01", new CultureInfo("en-US"), DateTimeStyles.None, out startDate);
Console.WriteLine(startDate.ToString("D", c));
The Windows 10 result (fine): پنجشنبه, 12 بهمن 1368
The Windows 2012 result (just persian letters):پنجشنبه، 01 فوريه 1990
It's most likely that the
fr-IR
culture is not installed on the server.See Installing more cultures on Windows Server 2012 for more help.