0

我想问一下手动YearMonthPattern设置CurrentCulture? 我的问题是我将当前文化设置为Invariant,然后YearMonthPattern更改。

我所做的YearMonthPattern只是在设置文化之后添加代码来设置。

//Set Cultures
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(127);
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(127);
//Set Year Month Pattern
System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.YearMonthPattern = "MMMM, yyyy";
4

1 回答 1

1

我看不出有什么问题。只是它可能不符合实际的文化模式,但如果这就是你想要显示年份的方式,那没关系。

于 2011-07-11T11:02:52.013 回答