HijriCalendar.HijriAdjustment プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > HijriCalendar.HijriAdjustment プロパティの意味・解説 

HijriCalendar.HijriAdjustment プロパティ

Ramadan開始および終了変動や、国/地域ごとの日付の差に対応するように暦に加算または減算する日数取得または設定します

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

Dim instance As HijriCalendar
Dim value As Integer

value = instance.HijriAdjustment

instance.HijriAdjustment = value
public int HijriAdjustment { get;
 set; }
public:
property int HijriAdjustment {
    int get ();
    void set (int value);
}
/** @property */
public int get_HijriAdjustment ()

/** @property */
public void set_HijriAdjustment (int
 value)
public function get HijriAdjustment
 () : int

public function set HijriAdjustment
 (value : int)

プロパティ
暦に加算または減算する日数を表す -2 ~ 2 の整数

例外例外
例外種類条件

ArgumentOutOfRangeException

プロパティ無効な値に設定されています。

解説解説

HijriCalendar クラスのこの実装では、0 ~ 2 日の値を加算または減算することによって、Ramadan開始および終了変動や、国/地域ごとの日付の差に対応するように暦の日付調整されます。その値は、HijriAdjustment プロパティ格納されます。HijriAdjustment明示的に設定されていない場合は、Windows の [コントロール パネル] の [地域と言語オプション] (オペレーティング システムによっては [地域オプション] または [地域]) の設定からその値が取得されレジストリ値 HKEY_CURRENT_USER\Control Panel\International\AddHijriDate に格納されます。しかし、その情報AppDomain有効期間中に変更される場合ありますHijriCalendar クラスは、システム設定変更自動的に検出しません。

使用例使用例

HijriAdjustment日付への影響を示すコード例次に示します

Imports System
Imports System.Globalization

Public Class SamplesHijriCalendar

   Public Shared Sub Main()

      ' Creates and initializes a HijriCalendar.
      Dim myCal As New HijriCalendar()

      ' Creates a DateTime and initializes it to the second day of the
 first month of the year 1422.
      Dim myDT As New DateTime(1422,
 1, 2, myCal)

      ' Displays the current values of the DateTime.
      Console.WriteLine("HijriAdjustment is {0}.",
 myCal.HijriAdjustment)
      Console.WriteLine("   Year is {0}.", myCal.GetYear(myDT))
      Console.WriteLine("   Month is {0}.", myCal.GetMonth(myDT))
      Console.WriteLine("   Day is {0}.", myCal.GetDayOfMonth(myDT))

      ' Sets the HijriAdjustment property to 2.
      myCal.HijriAdjustment = 2
      Console.WriteLine("HijriAdjustment is {0}.",
 myCal.HijriAdjustment)
      Console.WriteLine("   Year is {0}.", myCal.GetYear(myDT))
      Console.WriteLine("   Month is {0}.", myCal.GetMonth(myDT))
      Console.WriteLine("   Day is {0}.", myCal.GetDayOfMonth(myDT))

      ' Sets the HijriAdjustment property to -2.
      myCal.HijriAdjustment = - 2
      Console.WriteLine("HijriAdjustment is {0}.",
 myCal.HijriAdjustment)
      Console.WriteLine("   Year is {0}.", myCal.GetYear(myDT))
      Console.WriteLine("   Month is {0}.", myCal.GetMonth(myDT))
      Console.WriteLine("   Day is {0}.", myCal.GetDayOfMonth(myDT))

   End Sub 'Main 

End Class 'SamplesHijriCalendar


'This code produces the following output.  Results vary depending on
 the registry settings.
'
'HijriAdjustment is 0.
'   Year is 1422.
'   Month is 1.
'   Day is 2.
'HijriAdjustment is 2.
'   Year is 1422.
'   Month is 1.
'   Day is 4.
'HijriAdjustment is -2.
'   Year is 1421.
'   Month is 12.
'   Day is 29.

using System;
using System.Globalization;

public class SamplesHijriCalendar  {

   public static void Main()
  {

      // Creates and initializes a HijriCalendar.
      HijriCalendar myCal = new HijriCalendar();

      // Creates a DateTime and initializes it to the second day of
 the first month of the year 1422.
      DateTime myDT = new DateTime( 1422, 1, 2, myCal );

      // Displays the current values of the DateTime.
      Console.WriteLine( "HijriAdjustment is {0}.", myCal.HijriAdjustment
 );
      Console.WriteLine( "   Year is {0}.", myCal.GetYear( myDT ) );
      Console.WriteLine( "   Month is {0}.", myCal.GetMonth( myDT ) );
      Console.WriteLine( "   Day is {0}.", myCal.GetDayOfMonth( myDT )
 );

      // Sets the HijriAdjustment property to 2.
      myCal.HijriAdjustment = 2;
      Console.WriteLine( "HijriAdjustment is {0}.", myCal.HijriAdjustment
 );
      Console.WriteLine( "   Year is {0}.", myCal.GetYear( myDT ) );
      Console.WriteLine( "   Month is {0}.", myCal.GetMonth( myDT ) );
      Console.WriteLine( "   Day is {0}.", myCal.GetDayOfMonth( myDT )
 );

      // Sets the HijriAdjustment property to -2.
      myCal.HijriAdjustment = -2;
      Console.WriteLine( "HijriAdjustment is {0}.", myCal.HijriAdjustment
 );
      Console.WriteLine( "   Year is {0}.", myCal.GetYear( myDT ) );
      Console.WriteLine( "   Month is {0}.", myCal.GetMonth( myDT ) );
      Console.WriteLine( "   Day is {0}.", myCal.GetDayOfMonth( myDT )
 );

   }

}

/*
This code produces the following output.  Results vary depending on the registry
 settings.

HijriAdjustment is 0.
   Year is 1422.
   Month is 1.
   Day is 2.
HijriAdjustment is 2.
   Year is 1422.
   Month is 1.
   Day is 4.
HijriAdjustment is -2.
   Year is 1421.
   Month is 12.
   Day is 29.

*/
using namespace System;
using namespace System::Globalization;
int main()
{
   
   // Creates and initializes a HijriCalendar.
   HijriCalendar^ myCal = gcnew HijriCalendar;
   
   // Creates a DateTime and initializes it to the second day of the
 first month of the year 1422.
   DateTime myDT = DateTime(1422,1,2,myCal);
   
   // Displays the current values of the DateTime.
   Console::WriteLine( "HijriAdjustment is {0}.", myCal->HijriAdjustment
 );
   Console::WriteLine( "   Year is {0}.", myCal->GetYear( myDT ) );
   Console::WriteLine( "   Month is {0}.", myCal->GetMonth( myDT ) );
   Console::WriteLine( "   Day is {0}.", myCal->GetDayOfMonth( myDT
 ) );
   
   // Sets the HijriAdjustment property to 2.
   myCal->HijriAdjustment = 2;
   Console::WriteLine( "HijriAdjustment is {0}.", myCal->HijriAdjustment
 );
   Console::WriteLine( "   Year is {0}.", myCal->GetYear( myDT ) );
   Console::WriteLine( "   Month is {0}.", myCal->GetMonth( myDT ) );
   Console::WriteLine( "   Day is {0}.", myCal->GetDayOfMonth( myDT
 ) );
   
   // Sets the HijriAdjustment property to -2.
   myCal->HijriAdjustment = -2;
   Console::WriteLine( "HijriAdjustment is {0}.", myCal->HijriAdjustment
 );
   Console::WriteLine( "   Year is {0}.", myCal->GetYear( myDT ) );
   Console::WriteLine( "   Month is {0}.", myCal->GetMonth( myDT ) );
   Console::WriteLine( "   Day is {0}.", myCal->GetDayOfMonth( myDT
 ) );
}

/*
This code produces the following output.  Results vary depending on the registry
 settings.

HijriAdjustment is 0.
Year is 1422.
Month is 1.
Day is 2.
HijriAdjustment is 2.
Year is 1422.
Month is 1.
Day is 4.
HijriAdjustment is -2.
Year is 1421.
Month is 12.
Day is 29.

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

public class SamplesHijriCalendar
{
    public static void main(String[]
 args)
    {
        // Creates and initializes a HijriCalendar.
        HijriCalendar myCal = new HijriCalendar();

        // Creates a DateTime and initializes it to the second day of
 the 
        //first month of the year 1422.
        DateTime myDT = new DateTime(1422, 1, 2, myCal);

        // Displays the current values of the DateTime.
        Console.WriteLine("HijriAdjustment is {0}.", 
            System.Convert.ToString(myCal.get_HijriAdjustment()));
        Console.WriteLine("   Year is {0}.", 
            System.Convert.ToString(myCal.GetYear(myDT)));
        Console.WriteLine("   Month is {0}.", 
            System.Convert.ToString(myCal.GetMonth(myDT)));
        Console.WriteLine("   Day is {0}.", 
            System.Convert.ToString(myCal.GetDayOfMonth(myDT)));

        // Sets the HijriAdjustment property to 2.
        myCal.set_HijriAdjustment(2);
        Console.WriteLine("HijriAdjustment is {0}.", 
            System.Convert.ToString(myCal.get_HijriAdjustment()));
        Console.WriteLine("   Year is {0}.", 
            System.Convert.ToString(myCal.GetYear(myDT)));
        Console.WriteLine("   Month is {0}.", 
            System.Convert.ToString(myCal.GetMonth(myDT)));
        Console.WriteLine("   Day is {0}.", 
            System.Convert.ToString(myCal.GetDayOfMonth(myDT)));

        // Sets the HijriAdjustment property to -2.
        myCal.set_HijriAdjustment(-2);
        Console.WriteLine("HijriAdjustment is {0}.", 
            System.Convert.ToString(myCal.get_HijriAdjustment()));
        Console.WriteLine("   Year is {0}.", 
            System.Convert.ToString(myCal.GetYear(myDT)));
        Console.WriteLine("   Month is {0}.", 
            System.Convert.ToString(myCal.GetMonth(myDT)));
        Console.WriteLine("   Day is {0}.", 
            System.Convert.ToString(myCal.GetDayOfMonth(myDT)));
    } //main 
} //SamplesHijriCalendar

/*
This code produces the following output.  Results vary depending on the 
registry settings.

HijriAdjustment is 0.
   Year is 1422.
   Month is 1.
   Day is 2.
HijriAdjustment is 2.
   Year is 1422.
   Month is 1.
   Day is 4.
HijriAdjustment is -2.
   Year is 1421.
   Month is 12.
   Day is 29.
*/
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

HijriCalendar.HijriAdjustment プロパティのお隣キーワード
検索ランキング

   

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



HijriCalendar.HijriAdjustment プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS