GregorianCalendar コンストラクタ ()とは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > GregorianCalendar コンストラクタ ()の意味・解説 

GregorianCalendar コンストラクタ ()

既定の GregorianCalendarTypes 値を使用してGregorianCalendar クラス新しインスタンス初期化します。

名前空間: System.Globalization
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

解説解説

既定GregorianCalendarTypes 値は Localized です。CultureInfo の DateTimeFormatInfo.Calendar プロパティがこのコンストラクタ作成した GregorianCalendar設定されている場合日付と時刻CultureInfo関連付けられている言語ローカライズされます

使用例使用例

ローカライズされた GregorianCalendar使用して DateTime出力するコードの例次に示します

Imports System
Imports System.Globalization

Public Class SamplesGregorianCalendar

   Public Shared Sub Main()

      ' Creates and initializes three different CultureInfo.
      Dim myCIarSA As New
 CultureInfo("ar-SA", False)
      Dim myCIdeDE As New
 CultureInfo("de-DE", False)
      Dim myCIenUS As New
 CultureInfo("en-US", False)
      Dim myCIfrFR As New
 CultureInfo("fr-FR", False)

      ' Creates a Localized GregorianCalendar.
      ' GregorianCalendarTypes.Localized is the default when using the
 GregorianCalendar constructor without parameters.
      Dim myCal = New GregorianCalendar()

      ' Sets the DateTimeFormatInfo.Calendar property to a Localized
 GregorianCalendar.
      ' Localized GregorianCalendar is the default calendar for de-DE,
 en-US, and fr-FR,
      myCIarSA.DateTimeFormat.Calendar = myCal

      ' Creates a DateTime.
      Dim myDT As New DateTime(2002,
 1, 3, 13, 30, 45)

      ' Displays the DateTime.
      Console.WriteLine("ar-SA: {0}", myDT.ToString("F",
 myCIarSA))
      Console.WriteLine("de-DE: {0}", myDT.ToString("F",
 myCIdeDE))
      Console.WriteLine("en-US: {0}", myDT.ToString("F",
 myCIenUS))
      Console.WriteLine("fr-FR: {0}", myDT.ToString("F",
 myCIfrFR))

   End Sub 'Main 

End Class 'SamplesGregorianCalendar


'This code produces the following output. The question marks take the
 place of native script characters.
'
'ar-SA: 03 ?????, 2002 01:30:45 ?
'de-DE: Donnerstag, 3. Januar 2002 13:30:45
'en-US: Thursday, January 03, 2002 1:30:45 PM
'fr-FR: jeudi 3 janvier 2002 13:30:45

using System;
using System.Globalization;


public class SamplesGregorianCalendar  {

   public static void Main()
  {

      // Creates and initializes three different CultureInfo.
      CultureInfo myCIarSA = new CultureInfo("ar-SA",
 false);
      CultureInfo myCIdeDE = new CultureInfo("de-DE",
 false);
      CultureInfo myCIenUS = new CultureInfo("en-US",
 false);
      CultureInfo myCIfrFR = new CultureInfo("fr-FR",
 false);

      // Creates a Localized GregorianCalendar.
      // GregorianCalendarTypes.Localized is the default when using
 the GregorianCalendar constructor without parameters.
      Calendar myCal = new GregorianCalendar();

      // Sets the DateTimeFormatInfo.Calendar property to a Localized
 GregorianCalendar.
      // Localized GregorianCalendar is the default calendar for de-DE,
 en-US, and fr-FR,
      myCIarSA.DateTimeFormat.Calendar = myCal;

      // Creates a DateTime.
      DateTime myDT = new DateTime( 2002, 1, 3, 13, 30, 45 );

      // Displays the DateTime.
      Console.WriteLine( "ar-SA: {0}", myDT.ToString( "F", myCIarSA
 ) );
      Console.WriteLine( "de-DE: {0}", myDT.ToString( "F", myCIdeDE
 ) );
      Console.WriteLine( "en-US: {0}", myDT.ToString( "F", myCIenUS
 ) );
      Console.WriteLine( "fr-FR: {0}", myDT.ToString( "F", myCIfrFR
 ) );

   }

}

/*
This code produces the following output. The question marks take the place of native
 script characters.

ar-SA: 03 ?????, 2002 01:30:45 ?
de-DE: Donnerstag, 3. Januar 2002 13:30:45
en-US: Thursday, January 03, 2002 1:30:45 PM
fr-FR: jeudi 3 janvier 2002 13:30:45

*/
using namespace System;
using namespace System::Globalization;
int main()
{
   
   // Creates and initializes three different CultureInfo.
   CultureInfo^ myCIarSA = gcnew CultureInfo( "ar-SA",false
 );
   CultureInfo^ myCIdeDE = gcnew CultureInfo( "de-DE",false
 );
   CultureInfo^ myCIenUS = gcnew CultureInfo( "en-US",false
 );
   CultureInfo^ myCIfrFR = gcnew CultureInfo( "fr-FR",false
 );
   
   // Creates a Localized GregorianCalendar.
   // GregorianCalendarTypes::Localized is the default when using the
 GregorianCalendar constructor with->Item[Out] parameters.
   Calendar^ myCal = gcnew GregorianCalendar;
   
   // Sets the DateTimeFormatInfo::Calendar property to a Localized
 GregorianCalendar.
   // Localized GregorianCalendar is the default calendar for de-DE,
 en-US, and fr-FR,
   myCIarSA->DateTimeFormat->Calendar = myCal;
   
   // Creates a DateTime.
   DateTime myDT = DateTime(2002,1,3,13,30,45);
   
   // Displays the DateTime.
   Console::WriteLine( "ar-SA: {0}", myDT.ToString( "F", myCIarSA
 ) );
   Console::WriteLine( "de-DE: {0}", myDT.ToString( "F", myCIdeDE
 ) );
   Console::WriteLine( "en-US: {0}", myDT.ToString( "F", myCIenUS
 ) );
   Console::WriteLine( "fr-FR: {0}", myDT.ToString( "F", myCIfrFR
 ) );
}

/*
This code produces the following output. The question marks take the place of native
 script characters.

ar-SA: 03 ?????, 2002 01:30:45 ?
de-DE: Donnerstag, 3. Januar 2002 13:30:45
en-US: Thursday, January 03, 2002 1:30:45 PM
fr-FR: jeudi 3 janvier 2002 13:30:45

*/
import System.* ;
import System.Globalization.* ;

public class SamplesGregorianCalendar
{
    public static void main(String[]
 args)
    {
        // Creates and initializes three different CultureInfo.
        CultureInfo myCIarSA =  new CultureInfo("ar-SA",
 false);
        CultureInfo myCIdeDE =  new CultureInfo("de-DE",
 false);
        CultureInfo myCIenUS =  new CultureInfo("en-US",
 false);
        CultureInfo myCIfrFR =  new CultureInfo("fr-FR",
 false);

        // Creates a Localized GregorianCalendar.
        // GregorianCalendarTypes.Localized is the default when using
 the
        // GregorianCalendar constructor without parameters.
        Calendar myCal = new GregorianCalendar();

        // Sets the DateTimeFormatInfo.Calendar property to a 
        // Localized GregorianCalendar.
        // Localized GregorianCalendar is the default calendar for
        // de-DE, en-US, and fr-FR,
        myCIarSA.get_DateTimeFormat().set_Calendar( myCal);

        // Creates a DateTime.
        DateTime myDT =  new DateTime(2002, 1, 3, 13, 30, 45);

        // Displays the DateTime.
        Console.WriteLine("ar-SA: {0}", myDT.ToString("F", myCIarSA));
        Console.WriteLine("de-DE: {0}", myDT.ToString("F", myCIdeDE));
        Console.WriteLine("en-US: {0}", myDT.ToString("F", myCIenUS));
        Console.WriteLine("fr-FR: {0}", myDT.ToString("F", myCIfrFR));
    } //main 
} //SamplesGregorianCalendar

/*
This code produces the following output. The question marks take the place 
    of native script characters.

ar-SA: 03 ?????, 2002 01:30:45 ?
de-DE: Donnerstag, 3. Januar 2002 13:30:45
en-US: Thursday, January 03, 2002 1:30:45 PM
fr-FR: jeudi 3 janvier 2002 13:30:45
*/
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

GregorianCalendar コンストラクタ (GregorianCalendarTypes)

GregorianCalendarTypes 値を指定してGregorianCalendar クラス新しインスタンス初期化します。

名前空間: System.Globalization
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Sub New ( _
    type As GregorianCalendarTypes _
)
public GregorianCalendar (
    GregorianCalendarTypes type
)
public:
GregorianCalendar (
    GregorianCalendarTypes type
)
public GregorianCalendar (
    GregorianCalendarTypes type
)
public function GregorianCalendar (
    type : GregorianCalendarTypes
)

パラメータ

type

作成する暦の言語バージョンを示す GregorianCalendarTypes 値。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

GregorianCalendar コンストラクタ




英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「GregorianCalendar コンストラクタ ()」の関連用語

GregorianCalendar コンストラクタ ()のお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



GregorianCalendar コンストラクタ ()のページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS