System.Globalization.JapaneseCalendar.GetEra C# (CSharp) Méthode

GetEra() public méthode

public GetEra ( System.DateTime time ) : int
time System.DateTime
Résultat int
        public override int GetEra(DateTime time) {
            return (helper.GetEra(time));
        }

Usage Example

Exemple #1
0
        public static string ToJaCal(this DateTime d)
        {
            JapaneseCalendar jaCal = new JapaneseCalendar();

            var nengo = new string[]{ "明治", "大正", "昭和", "平成" };

            var nen = nengo[jaCal.GetEra(d) - 1] + jaCal.GetYear(d) + "年";
            var tsuki = d.Month + "月";
            var hi = d.Day + "日";

            return nen + tsuki + hi;
        }
All Usage Examples Of System.Globalization.JapaneseCalendar::GetEra