日付を和暦で表示する方法

 日付を和暦で表示するには、JapaneseCalendar クラスを使って求めます。
【使い方】
// 年号を表す文字列配列生成します。
string[] EraName = new string[]{"", "明治", "大正", "昭和", "平成"};

JapaneseCalendar jc = new JapaneseCalendar();

// 元号を現す番号を取得します。
int Era = jc.GetEra( date );

// 元号を現す文字列を取得します。
string strEra = EraName[jc.GetEra( date )];

// 和暦年を取得します。
int year = jc.GetYear( date );
【補足】
戻る