把整成C#中的月份名称的最好方法?名称、方法

由网友(沙漏里的时光)分享简介:有没有把整成.NET的月份名称?Is there a best way to turn an integer into its month name in .net?很显然,我可以旋转起来日期时间串并分析当月的名字在那里。这似乎只是时间的巨大浪费。Obviously I can spin up a datetim...

有没有把整成.NET的月份名称?

Is there a best way to turn an integer into its month name in .net?

很显然,我可以旋转起来日期时间串并分析当月的名字在那里。这似乎只是时间的巨大浪费。

Obviously I can spin up a datetime to string it and parse the month name out of there. That just seems like a gigantic waste of time.

推荐答案

从的DateTimeFormatInfo尝试GetMonthName

Try GetMonthName from DateTimeFormatInfo

http://msdn.microsoft.com/en-us/library/system.globalization.datetimeformatinfo.getmonthname.aspx

您可以做到这一点:

CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(1);
阅读全文

相关推荐

最新文章