[英]Persian culture in Windows Server 2012 r2
In our development machine which is running on Windows 10, "fa-IR" culture works fine and all dates display using Persian calendar.在我们在 Windows 10 上运行的开发机器中,“fa-IR”文化运行良好,所有日期都使用波斯日历显示。 But when we deploy our app on Windows Server 2012 r2, datetime is still in Gregorian.但是当我们在 Windows Server 2012 r2 上部署我们的应用程序时,日期时间仍然是公历。
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:为了澄清我们在 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));
The Windows 10 result (fine): پنجشنبه, 12 بهمن 1368 Windows 10 结果(很好):پنجشنبه,12 بهمن 1368
The Windows 2012 result (just persian letters):پنجشنبه، 01 فوريه 1990 Windows 2012 结果(仅波斯字母):پنجشنبه، 01 فوريه 1990
It's most likely that the fr-IR
culture is not installed on the server.最有可能的fr-IR
区域性没有安装在服务器上。
See Installing more cultures on Windows Server 2012 for more help.有关更多帮助,请参阅在 Windows Server 2012 上安装更多文化。
This depends on the version of Windows, Persian calendar was added in Windows Server 2012 R2 And Windows 10.这取决于 Windows 的版本,在 Windows Server 2012 R2 和 Windows 10 中添加了波斯日历。
SQL Server FORMAT with culture parameter not working带有文化参数的 SQL Server FORMAT 不起作用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.