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 | “March” |
4 | “April” |
5 | “May” |
6 | “June” |
7 | “7 月” |
8 | “8 月” |
9 | “9 月” |
10 | “10 月” |
11 | “11 月” |
12 | “December” |
13 | "" |
Calendar 物件可以容納 13 個月的行事曆。 針對12個月行事曆,空字串一律會傳回為第13個月的名稱。
適用於
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應