DateTimeFormatInfo.GetMonthName(Int32) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
根據與目前 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 | 年3月 |
4 | 年4月 |
5 | 會 |
6 | 年6月 |
7 | 月份 |
8 | 以後 |
9 | 19-22 |
10 | 2009 |
11 | 月 |
12 | 11 |
13 | "" |
Calendar 物件可以容納有13個月的行事曆。 若為12個月的行事曆,則一律會傳回空字串作為第13個月的名稱。