DateTimeFormatInfo.GetMonthName(Int32) 方法

定义

基于与当前 DateTimeFormatInfo 对象关联的区域性,返回指定月份的区域性特定的全名。

public:
 System::String ^ GetMonthName(int month);
public string GetMonthName (int month);
member this.GetMonthName : int -> string
Public Function GetMonthName (month As Integer) As String

参数

month
Int32

1 到 13 之间的一个整数,用于表示要检索的月份的名称。

返回

month 表示的月份的区域性特定的全名。

例外

month 小于 1 或大于 13。

注解

对于默认固定 DateTimeFormatInfo 对象,此方法从 GregorianCalendar 对象返回字符串。

month 返回值
1 “January”
2 “二月”
3 “March”
4 “四月”
5 “May”
6 “June”
7 “July”
8 “八月”
9 “九月”
10 “10 月”
11 “11 月”
12 “十二月”
13 ""

Calendar 对象可以容纳包含 13 个月的日历。 对于 12 个月日历,空字符串始终作为第 13 个月的名称返回。

适用于

另请参阅