Export (0) Print
Expand All

BaseCompareValidator.GetFullYear Method

Generates the four-digit year representation of the specified two-digit year.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

protected static int GetFullYear(
	int shortYear
)

Parameters

shortYear
Type: System.Int32

A two-digit year.

Return Value

Type: System.Int32
The four-digit year representation of the specified two-digit year.

Use the GetFullYear method to generate the four-digit year representation of the specified two-digit year. The four-digit year representation depends on the value of the CutoffYear property, which contains the maximum year that can be represented by a two-digit year in a 100-year range. For example, if the CutoffYear property contains the value 2029, the GetFullYear method returns a year between 1930 and 2029. The two-digit year 30 is interpreted as 1930, while 29 is interpreted as 2029. You can change the maximum year that can be represented by a two-digit year by setting the Calendar.TwoDigitYearMax property.

NoteNote

Because this method is static, you can use it without creating an instance of the class by qualifying the method name along with the class name--for example, BaseCompareValidator.GetFullYear.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft