Windows Server 2012 r2中的波斯文化

问题描述 投票:3回答:2

在我们在Windows 10上运行的开发机器中,“fa-IR”文化工作正常,所有日期都使用波斯日历显示。但是当我们在Windows Server 2012 r2上部署我们的应用程序时,datetime仍然是Gregorian。

c# globalization windows-server persian-calendar
2个回答
0
投票

最有可能的是fr-IR文化没有安装在服务器上。

请参阅Installing more cultures on Windows Server 2012以获取更多帮助。


0
投票

为了澄清我们在Windows Server2012中使用fa-IR所遇到的问题,这里有一个在Windows 10中正常工作但在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));

Windows 10的结果(罚款):1368年2月12日,星期四 Windows 2012结果(只是波斯语字母):1990年2月1日星期四

© www.soinside.com 2019 - 2024. All rights reserved.