System.DateTime.Year Property

Gets the year component of the date represented by this instance.

Syntax

public int Year { get; }

Value

A int between 1 and 9999 set to the year component of the current instance.

Remarks

The DateTime.Year property returns the year of the current instance in the Gregorian calendar. It does not return the year using the default calendar of the current culture. To retrieve the year using a particular calendar, you can call that calendar's GetYear method, as the following code shows.

code reference: System.DateTime.Year#1

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0