是否有最好的方法将整数转换为 .net 中的月份名称?
显然,我可以旋转一个日期时间来将其串起来并解析其中的月份名称。这似乎是对时间的巨大浪费。
最佳答案
尝试从 DateTimeFormatInfo 获取月份名称
http://msdn.microsoft.com/en-us/library/system.globalization.datetimeformatinfo.getmonthname.aspx
您可以通过以下方式做到这一点:
CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(1);
关于.net - 在 C# 中将整数转换为月份名称的最佳方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/218908/