다음을 통해 공유


JapaneseCalendar.Eras 속성

JapaneseCalendar에 있는 연대의 목록을 가져옵니다.

네임스페이스: System.Globalization
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
Public Overrides ReadOnly Property Eras As Integer()
‘사용 방법
Dim instance As JapaneseCalendar
Dim value As Integer()

value = instance.Eras
public override int[] Eras { get; }
public:
virtual property array<int>^ Eras {
    array<int>^ get () override;
}
/** @property */
public int[] get_Eras ()
public override function get Eras () : int[]

속성 값

JapaneseCalendar에 있는 연대를 나타내는 정수의 배열입니다.

설명

일본식 달력은 일본 국왕의 통치 기간마다 고유한 연대를 사용하는데, 현재 연대는 그레고리오력의 1989년부터 시작되는 헤이세이 연대입니다. 일반적으로 연대 이름은 연도 앞에 표시됩니다. 예를 들어, 그레고리오력의 2001년은 일본식 달력의 헤이세이 13년입니다. 연대의 첫 연도를 "간넨"이라 하므로 그레고리오력의 1989년은 일본식 달력의 헤이세이 간넨입니다.

이 클래스는 각 연대에 다음과 같은 값을 할당합니다.

GetEra 값

연대 이름

연대 약어

그레고리오식 날짜

4

平成 (헤이세이)

平 (H, h)

1989년 1월 8일에서 현재까지

3

昭和 (쇼와)

昭 (S, s)

1926년 12월 25일에서 1989년 1월 7일까지

2

大正 (다이쇼)

大 (T, t)

1912년 7월 30일에서 1926년 12월 24일까지

1

明治 (메이지)

明 (M, m)

1868년 9월 8일에서 1912년 7월 29일까지

이 클래스는 메이지 1년 9번째 달의 8번째 날(그레고리오력의 1868년 9월 8일)부터 날짜를 처리합니다. 일본식 달력은 메이지 6년(그레고리오력의 1873년)에 음력에서 양력으로 바뀌었지만 이 구현은 양력만 기반으로 합니다.

예제

다음 코드 예제에서는 Eras 속성에 포함된 값을 표시합니다.

Imports System
Imports System.Globalization

Public Class SamplesJapaneseCalendar

   Public Shared Sub Main()

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

      ' Displays the values in the Eras property.
      Dim i As Integer
      For i = 0 To myCal.Eras.Length - 1
         Console.WriteLine("Eras[{0}] = {1}", i, myCal.Eras(i))
      Next i

   End Sub 'Main 

End Class 'SamplesJapaneseCalendar

'This code produces the following output.
'
'Eras[0] = 4
'Eras[1] = 3
'Eras[2] = 2
'Eras[3] = 1
'
using System;
using System.Globalization;


public class SamplesJapaneseCalendar  {

   public static void Main()  {

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

      // Displays the values in the Eras property.
      for ( int i = 0; i < myCal.Eras.Length; i++ )  {
         Console.WriteLine( "Eras[{0}] = {1}", i, myCal.Eras[i] );
      }

   }

}

/*
This code produces the following output.

Eras[0] = 4
Eras[1] = 3
Eras[2] = 2
Eras[3] = 1

*/
using namespace System;
using namespace System::Globalization;
int main()
{
   
   // Creates and initializes a JapaneseCalendar.
   JapaneseCalendar^ myCal = gcnew JapaneseCalendar;
   
   // Displays the values in the Eras property.
   for ( int i = 0; i < myCal->Eras->Length; i++ )
   {
      Console::WriteLine( "Eras[ {0}] = {1}", i, myCal->Eras[ i ] );

   }
}

/*
This code produces the following output.

Eras->Item[0] = 4
Eras->Item[1] = 3
Eras->Item[2] = 2
Eras->Item[3] = 1

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

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

        // Displays the values in the get_Eras() property.
        for(int i=0;i < myCal.get_Eras().length;i++) {
            Console.WriteLine("Eras[{0}] = {1}",System.Convert.ToString(i),
                System.Convert.ToString(myCal.get_Eras().get_Item(i)));
        } 
    } //main
} //SamplesJapaneseCalendar

/*
This code produces the following output.

Eras[0] = 4
Eras[1] = 3
Eras[2] = 2
Eras[3] = 1

*/

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

JapaneseCalendar 클래스
JapaneseCalendar 멤버
System.Globalization 네임스페이스
CurrentEra