DateTimeFormatInfo.GetAbbreviatedMonthName(Int32) 方法

定義

根據與目前 DateTimeFormatInfo 物件關聯的文化特性,傳回指定月份的文化特性特有縮寫名稱。Returns the culture-specific abbreviated name of the specified month based on the culture associated with the current DateTimeFormatInfo object.

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

參數

month
Int32

從 1 到 13 的整數,表示要擷取的月份名稱。An integer from 1 through 13 representing the name of the month to retrieve.

傳回

month 所表示月份的特定文化特性之縮寫名稱。The culture-specific abbreviated name of the month represented by month.

例外狀況

month 小於 1 或大於 13。month is less than 1 or greater than 13.

備註

若為預設的DateTimeFormatInfo不變物件,這個方法會GregorianCalendar從物件傳回字串。For the default invariant DateTimeFormatInfo object, this method returns a string from the GregorianCalendar object.

month 傳回值Return Value
11 "Jan"
22 2"Feb"
33 2003"Mar"
44 Apr"Apr"
55 能夠"May"
66 06"Jun"
77 7"Jul"
88 "Aug"
99 4"Sep"
1010 "Oct"
1111 "Nov"
1212 十進位"Dec"
1313 """"

Calendar物件可以容納有13個月的行事曆。Calendar objects can accommodate calendars with 13 months. 若為12個月的行事曆,則一律會以第13個月的名稱傳回空字串。For 12-month calendars, the empty string is always returned as the name of the 13th month.

適用於

另請參閱