System.Globalization.GregorianCalendar.ToFourDigitYear C# (CSharp) Method

ToFourDigitYear() public method

public ToFourDigitYear ( int year ) : int
year int
return int
        public override int ToFourDigitYear(int year) {
            if (year > MaxYear) {
                throw new ArgumentOutOfRangeException(
                            "year",
                            String.Format(
                                CultureInfo.CurrentCulture,
                                Environment.GetResourceString("ArgumentOutOfRange_Range"), 1, MaxYear));
            }
            return (base.ToFourDigitYear(year));
        }
    }

Usage Example

 private void PosTest3(GregorianCalendarTypes calendarType)
 {
     System.Globalization.Calendar myCalendar = new GregorianCalendar(calendarType);
     int twoDigitYear;
     int expectedFourDigitYear, actualFourDigitYear;
     twoDigitYear = c_MIN_TWO_DIGIT_YEAR;
     expectedFourDigitYear = GetExpectedFourDigitYear(myCalendar, twoDigitYear);
     actualFourDigitYear = myCalendar.ToFourDigitYear(twoDigitYear);
     Assert.Equal(expectedFourDigitYear, actualFourDigitYear);
 }
All Usage Examples Of System.Globalization.GregorianCalendar::ToFourDigitYear