DateTimeFormatInfo.AbbreviatedMonthNames DateTimeFormatInfo.AbbreviatedMonthNames DateTimeFormatInfo.AbbreviatedMonthNames DateTimeFormatInfo.AbbreviatedMonthNames Property

定義

月を表すカルチャ固有の省略名を格納している 1 次元配列を取得または設定します。Gets or sets a one-dimensional string array that contains the culture-specific abbreviated names of the months.

public:
 property cli::array <System::String ^> ^ AbbreviatedMonthNames { cli::array <System::String ^> ^ get(); void set(cli::array <System::String ^> ^ value); };
public string[] AbbreviatedMonthNames { get; set; }
member this.AbbreviatedMonthNames : string[] with get, set
Public Property AbbreviatedMonthNames As String()

プロパティ値

String[]

月を表すカルチャ固有の省略名を格納している、13 個の要素を持つ 1 次元配列。A one-dimensional string array with 13 elements that contains the culture-specific abbreviated names of the months. 12 か月の暦では、配列の 13 番目の要素は空の文字列になります。For 12-month calendars, the 13th element of the array is an empty string. InvariantInfo の配列は、"Jan"、"Feb"、"Mar"、"Apr"、"May"、"Jun"、"Jul"、"Aug"、"Sep"、"Oct"、"Nov"、"Dec"、および "" を格納します。The array for InvariantInfo contains "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", and "".

例外

プロパティが null に設定されています。The property is being set to null.

プロパティが、多次元配列または配列長が厳密に 13 ではない配列に設定されています。The property is being set to an array that is multidimensional or that has a length that is not exactly 13.

このプロパティが設定されていますが、DateTimeFormatInfo オブジェクトは読み取り専用です。The property is being set and the DateTimeFormatInfo object is read-only.

次の例では、読み取り/書き込みCultureInfoオブジェクトが、英語 (米国) カルチャを表す省略属月名をそのAbbreviatedMonthNamesAbbreviatedMonthGenitiveNamesプロパティ。The following example creates a read/write CultureInfo object that represents the English (United States) culture and assigns abbreviated genitive month names to its AbbreviatedMonthNames and AbbreviatedMonthGenitiveNames properties. カルチャのサポートされる予定表の各月の省略名を含む日付の文字列表現が表示されます。It then displays the string representation of dates that include the abbreviated name of each month in the culture's supported calendar.

using System;
using System.Globalization;

public class Example
{
   public static void Main()
   {
      CultureInfo ci = CultureInfo.CreateSpecificCulture("en-US");
      DateTimeFormatInfo dtfi = ci.DateTimeFormat;
      dtfi.AbbreviatedMonthNames = new string[] { "of Jan", "of Feb", "of Mar", 
                                                  "of Apr", "of May", "of Jun", 
                                                  "of Jul", "of Aug", "of Sep", 
                                                  "of Oct", "of Nov", "of Dec", "" };  
      dtfi.AbbreviatedMonthGenitiveNames = dtfi.AbbreviatedMonthNames;
      DateTime dat = new DateTime(2012, 5, 28);
      
      for (int ctr = 0; ctr < dtfi.Calendar.GetMonthsInYear(dat.Year); ctr++)
         Console.WriteLine(dat.AddMonths(ctr).ToString("dd MMM yyyy", dtfi));
   }
}
// The example displays the following output:
//       28 of May 2012
//       28 of Jun 2012
//       28 of Jul 2012
//       28 of Aug 2012
//       28 of Sep 2012
//       28 of Oct 2012
//       28 of Nov 2012
//       28 of Dec 2012
//       28 of Jan 2013
//       28 of Feb 2013
//       28 of Mar 2013
//       28 of Apr 2013
Imports System.Globalization

Module Example
   Public Sub Main()
      Dim ci As CultureInfo = CultureInfo.CreateSpecificCulture("en-US")
      Dim dtfi As DateTimeFormatInfo = ci.DateTimeFormat
      dtfi.AbbreviatedMonthNames = { "of Jan", "of Feb", "of Mar", 
                                     "of Apr", "of May", "of Jun", 
                                     "of Jul", "of Aug", "of Sep", 
                                     "of Oct", "of Nov", "of Dec", "" }  
      dtfi.AbbreviatedMonthGenitiveNames = dtfi.AbbreviatedMonthNames
      Dim dat As Date = #05/28/2012#
      
      For ctr As Integer = 0 To dtfi.Calendar.GetMonthsInYear(dat.Year) - 1
         Console.WriteLine(dat.AddMonths(ctr).ToString("dd MMM yyyy", dtfi))
      Next
   End Sub
End Module
' The example displays the following output:
'       28 of May 2012
'       28 of Jun 2012
'       28 of Jul 2012
'       28 of Aug 2012
'       28 of Sep 2012
'       28 of Oct 2012
'       28 of Nov 2012
'       28 of Dec 2012
'       28 of Jan 2013
'       28 of Feb 2013
'       28 of Mar 2013
'       28 of Apr 2013

注釈

このプロパティを設定する場合、配列は 1 次元で厳密に 13 個の要素である必要があります。If you set this property, the array must be one-dimensional with exactly 13 elements. Calendar オブジェクトでは、13 の月のカレンダーに対応します。Calendar objects accommodate calendars with 13 months. 最初の要素 (インデックス 0 位置にある要素) によって定義された年の最初の月を表す、Calendarプロパティ。The first element (the element at index zero) represents the first month of the year defined by the Calendar property.

設定した場合、AbbreviatedMonthNamesプロパティを設定する必要も、AbbreviatedMonthGenitiveNamesプロパティ。If you set the AbbreviatedMonthNames property, you must also set the AbbreviatedMonthGenitiveNames property. AbbreviatedMonthNamesAbbreviatedMonthGenitiveNames次の書式指定文字列を使用して日付の書式を設定するプロパティを使用します。The AbbreviatedMonthNames and AbbreviatedMonthGenitiveNames properties are used to format dates using the following format strings:

  • 標準の日付と時刻の書式指定文字列のエイリアス、カスタムの書式設定"MMM"を含む文字列書式指定子。A standard date and time format string that aliases a custom format string that includes the "MMM" format specifier.

  • カスタム日時書式指定文字列を含む"MMM"は書式指定子です。A custom date and time format string that includes the "MMM" format specifier.

このプロパティは影響を受けた場合の値、Calendarプロパティの変更。This property is affected if the value of the Calendar property changes. 場合、選択したCalendarサポートの簡略化された月名ではなく、配列には、完全な月の名前が含まれています。If the selected Calendar does not support abbreviated month names, the array contains the full month names.

適用対象

こちらもご覧ください