ToFourDigitYear Method

JapaneseCalendar.ToFourDigitYear Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Converts the specified year to a four-digit year by using the TwoDigitYearMax property to determine the appropriate century.

Namespace:  System.Globalization
Assembly:  mscorlib (in mscorlib.dll)

public override int ToFourDigitYear(
	int year
)

Parameters

year
Type: System.Int32
An integer (usually two digits) that represents the year to convert.

Return Value

Type: System.Int32
An integer that contains the four-digit representation of year.

ExceptionCondition
ArgumentOutOfRangeException

year is outside the range supported by the calendar.

This method implements Calendar.ToFourDigitYear.

Because the year in the Japanese calendar is typically less than four digits long, this implementation always returns the value of the year parameter unchanged if year is a two-digit value. If the application supplies a four-digit value, or if it supplies a zero or a negative value, ToFourDigitYear throws an exception.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft