다음을 통해 공유


HijriCalendar.HijriAdjustment 속성

정의

라마단의 시작 날짜 및 끝 날짜의 변동 사항과 국가별 날짜 차이를 조절하기 위해 달력 날짜에서 더하거나 뺄 일 수를 가져오거나 설정합니다.

public:
 property int HijriAdjustment { int get(); void set(int value); };
public int HijriAdjustment { get; set; }
member this.HijriAdjustment : int with get, set
Public Property HijriAdjustment As Integer

속성 값

달력 날짜에서 더하거나 뺄 일 수를 나타내는 -2에서 2 사이의 정수입니다.

예외

속성이 잘못된 값으로 설정된 경우

예제

다음 코드 예제에서는 날짜에 미치는 영향을 보여 HijriAdjustment 줍니다.

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.

*/
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.

*/
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

End Class


'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.

설명

클래스의 이 구현은 라마단의 HijriCalendar 시작과 끝의 분산을 수용하고 국가/지역 간의 날짜 차이를 수용하기 위해 값을 0에서 2일로 추가하거나 빼서 달력 날짜를 조정합니다. 해당 값은 속성에 HijriAdjustment 저장됩니다. 가 명시적으로 설정되지 않은 경우 HijriAdjustment 제어판 지역 및 언어 옵션 부분의 설정에서 해당 값을 파생시키고 HKEY_CURRENT_USER\Control Panel\International\AddHijriDate 레지스트리 값에 저장됩니다. 그러나 해당 정보는 의 수명 동안 변경 될 AppDomain수 있습니다. 클래스는 HijriCalendar 시스템 설정의 변경 내용을 자동으로 검색하지 않습니다.

적용 대상