Share via


Date.Year Property

Definition

Caution

deprecated

Returns a value that is the result of subtracting 1900 from the year that contains or begins with the instant in time represented by this Date object, as interpreted in the local time zone. -or- Sets the year of this Date object to be the specified value plus 1900.

[System.Obsolete("deprecated")]
public virtual int Year { [Android.Runtime.Register("getYear", "()I", "GetGetYearHandler")] get; [Android.Runtime.Register("setYear", "(I)V", "GetSetYear_IHandler")] set; }
[<System.Obsolete("deprecated")>]
[<get: Android.Runtime.Register("getYear", "()I", "GetGetYearHandler")>]
[<set: Android.Runtime.Register("setYear", "(I)V", "GetSetYear_IHandler")>]
member this.Year : int with get, set

Property Value

the year represented by this date, minus 1900.

Attributes

Remarks

Property getter documentation:

Returns a value that is the result of subtracting 1900 from the year that contains or begins with the instant in time represented by this Date object, as interpreted in the local time zone.

This member is deprecated. As of JDK version 1.1, replaced by Calendar.get(Calendar.YEAR) - 1900.

Java documentation for java.util.Date.getYear().

Property setter documentation:

Sets the year of this Date object to be the specified value plus 1900. This Date object is modified so that it represents a point in time within the specified year, with the month, date, hour, minute, and second the same as before, as interpreted in the local time zone. (Of course, if the date was February 29, for example, and the year is set to a non-leap year, then the new date will be treated as if it were on March 1.)

This member is deprecated. As of JDK version 1.1, replaced by Calendar.set(Calendar.YEAR, year + 1900).

Java documentation for java.util.Date.setYear(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to