文化特定的日期元素顺序(Culture specific order of date elements)
我想显示月份的字母和用户的日期。 我可以使用DateTime.ToString("MMMM d"); 但在某些国家/地区,正确的格式为d MMMMM 。
有没有办法确保订单永远正确?
I would like to display the month with letters and the day for the users. I could use DateTime.ToString("MMMM d"); but in some countries the correct format would be d MMMMM.
Is there a way to to ensure the order is always right?
最满意答案
不,没有办法。 只需快速浏览一下
[Globalization.CultureInfo]::GetCultures([Globalization.CultureTypes]::AllCultures) | select @{l='Culture';e={$_.Name}},@{l='Pattern';e={$_.DateTimeFormat.LongDatePattern}}揭示了许多文化,其中有月份名称和日期需要包含在某些内容中,而在某些其他内容中被排除在外。
No, there isn't a way. Just a quick browse through
[Globalization.CultureInfo]::GetCultures([Globalization.CultureTypes]::AllCultures) | select @{l='Culture';e={$_.Name}},@{l='Pattern';e={$_.DateTimeFormat.LongDatePattern}}reveals a lot of cultures where there are things around the month name and the day that need to be included in some and excluded in some others.
更多推荐
发布评论