Reputation: 51
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.
Upvotes: 5
Views: 955
Reputation: 3441
This depends on the version of Windows, Persian calendar was added in Windows Server 2012 R2 And Windows 10.
SQL Server FORMAT with culture parameter not working
Upvotes: 0
Reputation: 959
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
Upvotes: 2
Reputation: 35477
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.
Upvotes: 0