Calendar.Eras 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
파생 클래스에 재정의될 때 현재 달력의 연대 목록을 가져옵니다.
public:
abstract property cli::array <int> ^ Eras { cli::array <int> ^ get(); };
public abstract int[] Eras { get; }
member this.Eras : int[]
Public MustOverride ReadOnly Property Eras As Integer()
속성 값
- Int32[]
현재 달력의 연대를 나타내는 정수의 배열입니다.
예제
다음 예제에서는 헤이세이 시대(1989-2019)가 현재 시대였던 때에 포함된 JapaneseCalendar.Eras 값을 표시합니다.
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
*/
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
*/
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
End Class
'This code produces the following output.
'
'Eras[0] = 4
'Eras[1] = 3
'Eras[2] = 2
'Eras[3] = 1
'
설명
연대는 역순으로, 현재 시대는 배열의 첫 번째 요소로, 가장 오래된 시대는 배열의 마지막 요소입니다. 예를 들어 현재 연대 JapaneseCalendar 의 값은 배열의 첫 번째 요소인 4입니다. JapaneseCalendar 클래스와 JapaneseLunisolarCalendar 클래스만 여러 연대를 지원합니다.
중요
일본어 달력의 시대는 천황 통치 기간을 기준으로 하므로 변경되어야 합니다. 예를 들어 2019년 5월 1일은 JapaneseCalendar 및 JapaneseLunisolarCalendar에서 레이와 시대의 시작을 나타냅니다. 이러한 시대 변경 내용은 해당 달력을 사용하는 모든 애플리케이션에 영향을 줍니다. 자세한 내용 및 애플리케이션이 영향을 받는지 여부를 확인하려면 .NET에서 일본 달력의 새 시대 처리를참조하세요. Windows 시스템에서 애플리케이션을 테스트하여 시대 변화에 대한 준비 상태를 확인하는 자세한 내용은 일본 연호 변경을 위한 애플리케이션 준비를 참조하세요. 여러 시대가 있는 달력을 지원하는 .NET의 기능 및 여러 연호를 지원하는 달력으로 작업하는 경우 모범 사례는 연호 작업을 참조하세요.
및 JapaneseLunisolarCalendar 클래스는 JapaneseCalendar 여러 연대를 지원합니다. 반면에 대부분의 달력 구현은 단일 시대를 지원합니다.